This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 154084 - XML code completion sometimes doesn't show elements in default namespace.
Summary: XML code completion sometimes doesn't show elements in default namespace.
Status: RESOLVED WORKSFORME
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P3 blocker with 2 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-28 11:20 UTC by obrlord
Modified: 2013-05-02 15:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description obrlord 2008-11-28 11:20:07 UTC
When I have following xml file, the code completion doesn't provide suggestion inside publisher element.

<?xml version="1.0" encoding="UTF-8"?>
<b:books  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
          xmlns='http://xml.netbeans.org/schema/books2'
   	  xmlns:b='http://xml.netbeans.org/schema/books'
   	  xsi:schemaLocation='http://xml.netbeans.org/schema/books file:books.xsd
   	  http://xml.netbeans.org/schema/books2 file:books2.xsd'>
<b:book>
  <b:author>Martin Obratil</b:author>
    <b:name>Nice book</b:name>
      <publisher>
        <country>CZ</country>
        <name>Publisher</name>
      </publisher>
   </b:book>
</b:books>

It occurs to elements that are from default namespace and that are nested in elements, that are in non-default namespace
of document.

First XML schema books.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	    xmlns="http://xml.netbeans.org/schema/books"
    	    targetNamespace="http://xml.netbeans.org/schema/books"
    	    elementFormDefault="qualified">

  <xsd:element name="books">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="book" type="bookType" maxOccurs="unbounded"></xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    <xsd:complexType name="bookType">
      <xsd:sequence>
        <xsd:element name="author" type="authorType"></xsd:element>
        <xsd:element name="name" type="nameType"></xsd:element>
        <xsd:any processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="authorType">
      <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="nameType">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
</xsd:schema>

Second XML schema books2.xsd:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    	    targetNamespace="http://xml.netbeans.org/schema/books2"
    	    elementFormDefault="qualified" xmlns="http://xml.netbeans.org/schema/books2">
  <xsd:complexType name="publisherType">
    <xsd:sequence>
      <xsd:element name="country" type="countryType"></xsd:element>
      <xsd:element name="name" type="nameType"></xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:simpleType name="countryType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>
  <xsd:simpleType name="nameType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>
  <xsd:element name="publisher" type="publisherType"></xsd:element>
</xsd:schema>
Comment 1 Sergey Lunegov 2009-05-08 14:13:40 UTC
Code completion will be refactored in next release.
Comment 2 Svata Dedic 2013-05-02 15:02:02 UTC
Worksforme in 7.4dev