Validating inline schema

admin

Administrator
Staff member
Can anyone please help me to get the MSXML3 DOM to recognise the inline schemain an XML file. As a starting point, I have used the sample XML file fromthe MSDN article "The XML Files - September 2000", as follows:<foo xmlns:data="x-schema:#myInlineSchema"><Schema name="myInlineSchema" xmlns="urn:schemas-microsoft-com:xml-data"xmlns:dt="urn:schemas-microsoft-com:datatypes"><ElementType name="bar" dt:type="int"/></Schema><data:bar>28</data:bar></foo>I have attempted to access the example file, using MSXML3 from within VisualBasic 6.0, as follows:Dim XMLDoc As New DOMDocument30Dim XMLErr As IXMLDOMParseErrorXMLDoc.async = FalseXMLDoc.validateOnParse = TrueXMLDoc.Load App.Path & "\SampleFile.xml"Set XMLErr = XMLDoc.ValidateMsgBox XMLErr.reasonNo matter what I have tried, I have never managed to get beyond the validationerror message "Validate failed because the root element had no associatedDTD/schema".I assume I have done something fundamentally wrong, but I just can't discoverwhat it is. Any suggestions would be very welcome.Many thanks,Tim Coulter.
 
Back
Top