Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: MSXML 4.0 to 6.0 - Invalid Namespace And XMLSchemaCache MSXML 4.0 to 6.0 - Invalid Namespace And XMLSchemaCacheTo: NULL Date: 11/11/2008 10:20:00 AM My problem is as follows. I have some old code that uses MSXML. The code uses DOM and does schema validation. To validate schemas it uses an XMLSchemaCache to relate .XSD schema files to namespaces. This is all done at run time, and the namespaces/schemas are statically defined. This code was developed for MSXML v4.0, and everything worked. Now everything has been upgraded to MSXML v6.0 and there seems to be one problem. Everything is essentially the same with the inclusion of a few additional property settings (useInlineSchema, ResolveExternals, etc. taken from http://blogs.msdn.com/xmlteam/archive/2007/03/12/upgrading-to-msxml-6-0.aspx). The problem occurs when you try and load an XML file with an incorrect namespace. For example, here is an XML snippet. It sets up a namespace (sub) in the document. Now this namespace is tied to sub.xsd (schema) via the XMLSchemaCache. In this form all works well. Any element with a namespace of sub is validated with the sub.xsd schema. <NameSpace:SubProjectxmlns:sub="http://www.me.com/schemas/sub"> <sub:prop1 /> If you change the namespace to something invalid however, I run into a problem. <NameSpace:SubProject xmlns:sub="http://www.me.com/schemas/sub/junk"> <sub:prop1 /> In MSXML 4.0 an XML document with the above code will not load, and I get the proper error. In MSXML 6.0 the document loads, but everything under namespace sub is not validated with any schema (as it shouldn't be because it is not linked to a schema via the namespace cache). Do I need to flick a bit somewhere to get this same behavior in 6.0? Thanks for the help! Post is abusive | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
