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 268029

Summary: Autocompletion fails when the XSD includes another XSD
Product: xml Reporter: Xenos
Component: SchemaAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal CC: Xenos
Priority: P2    
Version: 8.1   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Showcase

Description Xenos 2016-09-14 17:47:04 UTC
When a XML uses a schema that includes another schema that defines the root node, then the auto-completion fails

<?xml version="1.0" encoding="utf-8"?>
<rootnode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
	<!-- NetBeans suggests nothing here -->
	<!-- While it actually validates well -->
	<subnode>auio</subnode>
</rootnode>


<?xml version="1.0"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:include schemaLocation="included.xsd"/>
</xs:schema>


<?xml version="1.0"?>
<xs:schema version="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:element name="rootnode">
		<xs:complexType mixed="true">
			<xs:sequence>
				<xs:element name="subnode" minOccurs="1" maxOccurs="1">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:pattern value="[aeiouy]+"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>



If the XML uses directly included.xsd, then the auto-completion works

<?xml version="1.0" encoding="utf-8"?>
<rootnode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="included.xsd">
	<!-- These will be suggested by NetBean's autocompletion -->
	<subnode>auio</subnode>
</rootnode>


I'm not sure whether it's a NB bug or a normal XML schema behavior.
Comment 1 Xenos 2016-09-14 17:48:02 UTC
Created attachment 162051 [details]
Showcase
Comment 2 Svata Dedic 2017-03-13 18:04:26 UTC
Support for xs:include and xs:import was missing from the underlying model. Implemented in jet-main#0e7654675b8b
Comment 3 Quality Engineering 2017-03-16 02:50:42 UTC
Integrated into 'main-silver', will be available in build *201703160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0e7654675b8b
User: Svata Dedic <sdedic@netbeans.org>
Log: #268029: Added read support for xs:include/import. Updated completion