![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: MSXML 4.0 to 6.0 - Invalid Namespace And XMLSchemaCache >Thread Next - Re: MSXML 4.0 to 6.0 - Invalid Namespace And XMLSchemaCache Re: MSXML 4.0 to 6.0 - Invalid Namespace And XMLSchemaCacheTo: NULL Date: 11/12/2008 12:25:00 PM Alright, I have some results. First and foremost, thank you very much for
your help.
I don't think I could have gotten to this point without it.
I created schema and XML files that matched yours, and I got the same exact
results (I'm using C++). So the problem is with my schemas, not MSXML.
I created a second test case that matches my current schemas. Below are
the edits I made to your examples.
Here is the schema file test2008111201Xsd.xml:
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!--xmlns:pf2="http://example.com/2008/ns2"-->
<!--targetNamespace="http://example.com/2008/ns1"-->
<!--<xs:import namespace="http://example.com/2008/ns2"
schemaLocation="test2008111202Xsd.xml"/>-->
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="foo">
<!--
<xs:complexType>
<xs:sequence>
<xs:element ref="pf2:bar"/>
</xs:sequence>
</xs:complexType>
-->
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Here is the schema file test2008111202Xsd.xml:
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!-- targetNamespace="http://example.com/2008/ns2" -->
<xs:element name="foo">
<xs:complexType>
<xs:sequence>
<xs:element ref="bar"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="bar" type="xs:int"/>
</xs:schema>
Here is an XML instance document named test2008111201.xml (same as before).
<pf1:root xmlns:pf1="http://example.com/2008/ns1">
<pf1:foo xmlns:pf2="http://example.com/2008/ns3">
<pf2:bar>foobar</pf2:bar>
</pf1:foo>
</pf1:root>
If I run the above I will get no error from MSXML6.0, but will get an error
for
MSXML 4.0. If I change 'n3' to 'n2', it tries to validate in both 6.0 and
4.0 (gives me an error because 'foobar' is not an int type).
So this might be some internal quirk that changed from 4.0 to 6.0, but the
real problem is likely with my schemas. Is this a valid way to write a schema?
Thanks again!
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
