Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 198390 | Differences between
and this patch

Collapse All | Expand All

(-)src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLElementImpl.java (-6 / +29 lines)
Lines 1586-1598 Link Here
1586
  protected String getNamespace(Element element)
1586
  protected String getNamespace(Element element)
1587
  {
1587
  {
1588
    String name = element.getTagName();
1588
    String name = element.getTagName();
1589
    int index = name.indexOf(":");
1589
    int index = name.indexOf(":"); //$NON-NLS-1$
1590
    if (index == -1)
1590
    String nsPrefix  = null;
1591
      return null;
1591
    if (index != -1)
1592
    else if (getEnclosingDefinition() != null)
1592
    {
1593
      return getEnclosingDefinition().getNamespace(name.substring(0, index));
1593
      nsPrefix = name.substring(0, index);
1594
    }
1594
    else
1595
    else
1595
      return null;
1596
    {
1597
      nsPrefix = "xmlns"; //$NON-NLS-1$
1598
    }
1599
1600
    String namespaceURI = null;
1601
1602
    // First try to locate the namespace URI in the definition's prefix to namespace map.
1603
    // This will provide backward compatibility for existing clients.
1604
    
1605
    Definition enclosingDefinition = getEnclosingDefinition();
1606
    if (enclosingDefinition != null)
1607
    {
1608
      namespaceURI = enclosingDefinition.getNamespace(nsPrefix);
1609
    }
1610
1611
    // We did not find it at the top level, try to find a locally defined namespace prefix.
1612
1613
    if (namespaceURI == null)
1614
    {
1615
      namespaceURI = getNamespaceURIFromPrefix(element, nsPrefix);
1616
    }
1617
1618
    return namespaceURI;
1596
  }
1619
  }
1597
1620
1598
  protected String getLocalName(Element element)
1621
  protected String getLocalName(Element element)

Return to bug 198390