Bug 268029 - Autocompletion fails when the XSD includes another XSD
Autocompletion fails when the XSD includes another XSD
Status: RESOLVED FIXED
Product: xml
Classification: Unclassified
Component: Schema
8.1
PC Windows 7
: P2 (vote)
: Dev
Assigned To: Svata Dedic
issues@xml
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-14 17:47 UTC by Xenos
Modified: 2017-03-16 02:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
Showcase (746 bytes, application/force-download)
2016-09-14 17:48 UTC, Xenos
Details

Note You need to log in before you can comment on or make changes to this bug.
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo