Hi, I am migrating from MSXML4 to MSXML6. In MSXML4 i use the schemas property of the IXMLDOMDocument interface: XMLDOMDocument.schemas := SchemaCache; MSXML4 ignores the schema references in the XML document (schemaLocation and noNamespaceSchemaLocation) when the schemas property is not Null. But MSXML6 seems to use schemaLocation and noNamespaceSchemaLocation instead of the schema references in the schema cache. Do i have to set a property to get the old behavior? thank you, - Gerben Abbink
Gerben Abbink wrote: > Hi, > > I am migrating from MSXML4 to MSXML6. In MSXML4 i use the schemas property > of the IXMLDOMDocument interface: > > XMLDOMDocument.schemas := SchemaCache; > > MSXML4 ignores the schema references in the XML document (schemaLocation and > noNamespaceSchemaLocation) when the schemas property is not Null. But MSXML6 > seems to use schemaLocation and noNamespaceSchemaLocation instead of the > schema references in the schema cache. > > Do i have to set a property to get the old behavior? According to http://msdn.microsoft.com/en-us/library/ms762261(VS.85).aspx with ValidateOnParse = true ResolveExternals = false UseInlineSchema = false the behaviour is as follows: "Validates the document against a schema resolved from a schema-cache. An inline schema and the schemaLocation attributes are ignored. This is the default behavior for MSXML 6.0." Does that not work for you? -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/
Ok, in my case ResolveExternals was True. But, "Validates the document against a schema resolved from a schema-cache or the schemaLocation attributes" is ambiguous. In my case attribute "schemaLocation" was used instead of the schema-cache which i find a bit strange. This way it's not possible to 'override' the schemaLocation that was given in the XML document. - Gerben "Martin Honnen" wrote in message news:e6xMmIp5IHA.3684@TK2MSFTNGP05.phx.gbl... > Gerben Abbink wrote: >> Hi, >> >> I am migrating from MSXML4 to MSXML6. In MSXML4 i use the schemas >> property of the IXMLDOMDocument interface: >> >> XMLDOMDocument.schemas := SchemaCache; >> >> MSXML4 ignores the schema references in the XML document (schemaLocation >> and noNamespaceSchemaLocation) when the schemas property is not Null. But >> MSXML6 seems to use schemaLocation and noNamespaceSchemaLocation instead >> of the schema references in the schema cache. >> >> Do i have to set a property to get the old behavior? > > > According to http://msdn.microsoft.com/en-us/library/ms762261(VS.85).aspx > with > > ValidateOnParse = true > > ResolveExternals = false > > UseInlineSchema = false > > the behaviour is as follows: > > "Validates the document against a schema resolved from a schema-cache. An > inline schema and the schemaLocation attributes are ignored. This is the > default behavior for MSXML 6.0." > > Does that not work for you? > > > > -- > > Martin Honnen --- MVP XML > http://JavaScript.FAQTs.com/