XmlValidatingRe ader too sensitive?
I have the following schemas (simplified) and xml file which validate
fine in xmlspy, but blow up in xmlvalidatingre ader 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="">, xmlvalidatingre ader 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"
elementFormDefa ult="qualified" >
<xsd:complexTyp e name="StaffingO rderType">
<xsd:element name="samplefie ld" type="xsd:strin g" />
</xsd:complexType >
<xsd:element name="StaffingO rder" type="StaffingO rderType" />
</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"
elementFormDefa ult="qualified" id="MultipleHRX ML">
<xs:include schemaLocation= "StaffingOr der-1_0.xsd" />
<xs:complexTy pe name="MultipleH RXMLSidesType">
<xs:element name="StaffingO rder" type="StaffingO rderType" />
</xs:complexType>
<xs:element name="MultipleH RXML-SIDES" type="MultipleH RXMLSidesType" />
</xs:schema>
example doc based on schema 2
-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<MultipleHRXM L-SIDES xmlns="http://ns.hr-xml.org/SIDES/SIDES-1_0"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://ns.hr-xml.org/SIDES/SIDES-1_0
http://localhost/HRXML/SIDES/SIDES-1_0/MultipleHRXML-SIDES-1_0.xsd">
<StaffingOrde r xsi:schemaLocat ion="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>te st</samplefield>
<!-- *****NOTE BELOW CAUSES THE PROBLEM******-->
<Hierarchy xmlns="">someva lue</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!