XmlValidatingReader too sensitive?
I have the following schemas (simplified) and xml file which validate
fine in xmlspy, but blow up in xmlvalidatingreader with:
'The 'Hierarchy' element is not declared. An error occurred'.
Any help appreciated.
To give a brief explanation of what I'm trying to do, the schema 1 is a
schema that is coming from a third party. The schema 2 is a wrapper
around that document.
The problem comes into light when a document based upon schema 1 has an
element outside of any namespace. Even though I qualify the tag, as in
<Hierarchy xmlns="">, xmlvalidatingreader chokes on it. xmlspy is fine.
schema 1 (3rd party)
--------
<xsd:schema targetNamespace="http://ns.hr-xml.org/SIDES/SIDES-1_0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://ns.hr-xml.org/SIDES/SIDES-1_0"
elementFormDefault="qualified">
<xsd:complexType name="StaffingOrderType">
<xsd:element name="samplefield" type="xsd:string" />
</xsd:complexType>
<xsd:element name="StaffingOrder" type="StaffingOrderType" />
</xsd:schema>
schema 2 (our wrapper hosted on our side)
--------
<xs:schema targetNamespace="http://ns.hr-xml.org/SIDES/SIDES-1_0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://ns.hr-xml.org/SIDES/SIDES-1_0"
elementFormDefault="qualified" id="MultipleHRXML">
<xs:include schemaLocation="StaffingOrder-1_0.xsd" />
<xs:complexType name="MultipleHRXMLSidesType">
<xs:element name="StaffingOrder" type="StaffingOrderType" />
</xs:complexType>
<xs:element name="MultipleHRXML-SIDES" type="MultipleHRXMLSidesType" />
</xs:schema>
example doc based on schema 2
-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<MultipleHRXML-SIDES xmlns="http://ns.hr-xml.org/SIDES/SIDES-1_0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.hr-xml.org/SIDES/SIDES-1_0
http://localhost/HRXML/SIDES/SIDES-1_0/MultipleHRXML-SIDES-1_0.xsd">
<StaffingOrder xsi:schemaLocation="http://ns.hr-xml.org/SIDES/SIDES-1_0
http://ns.hr-xml.org/SIDES/SIDES-1_0/StaffingOrder-1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ns.hr-xml.org/SIDES/SIDES-1_0">
<samplefield>test</samplefield>
<!-- *****NOTE BELOW CAUSES THE PROBLEM******-->
<Hierarchy xmlns="">somevalue</Hierarchy>
</StaffingOrder>
</MultipleHRXML-SIDES>
---Thanks in advance
Adam Smith
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!