[
https://issues.apache.org/jira/browse/XERCESC-1728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517298
]
Scott Cantor commented on XERCESC-1728:
---------------------------------------
Yep, you're right, I didn't realize the use of "ns2" above was meant literally
as a stand-in for a full namespace that would have to map to two different
schemas, and that's certainly wrong. So, never mind. ;-)
> Element defined in the imported schema file can not be correctly referred to
> ----------------------------------------------------------------------------
>
> Key: XERCESC-1728
> URL: https://issues.apache.org/jira/browse/XERCESC-1728
> Project: Xerces-C++
> Issue Type: Bug
> Components: Validating Parser (Schema) (Xerces 1.5 or up only)
> Affects Versions: 2.7.0
> Environment: Windows XP
> Reporter: Bill Yan
>
> There are there schema files in the following:
> testelemref.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="ns2"
> xmlns:nm1="ns1" targetNamespace="ns2" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:import namespace="ns1" schemaLocation="testelemref1.xsd"/>
> <xs:element name="elem3">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="nm1:elem1"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> testelemref1.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:n0="ns1"
> xmlns:n1="ns2" targetNamespace="ns1" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:import namespace="ns2" schemaLocation="testelemref2.xsd"/>
> <xs:element name="elem1">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="n0:elem2" minOccurs="0"/>
> <xs:element ref="n1:elem4" minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="elem2" type="xs:string"/>
> </xs:schema>
> testelemref2.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="ns2"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
> xmlns:nm1="ns2">
> <xs:element name="elem4" type="xs:string"/>
> </xs:schema>
> When I use XercesDOMParser::loadGrammar() to check the validity of
> testelemref.xsd, the following error is reported:
> "Type not found in ns2:elem4 - Line 8, Col 47"
> but when I use XMLSpy to check, it's valid, no error is found.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]