I try to load a document below... using MSXML2.DOMDocument.4.0 COM Object.
----------------------------------------------------------------------------
----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<my:myFields
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-02-19
T00:33:17" xml:lang="ko">
<my:field1></my:field1>
<my:field2></my:field2>
<my:field3>2004-02-12T23:30:20</my:field3>
<my:group1></my:group1>
<my:group2>
<my:group3>
<my:field4></my:field4>
<my:field5></my:field5>
</my:group3>
</my:group2>
<my:field6></my:field6>
<my:field7>false</my:field7>
<my:field8 xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></my:field8>
</my:myFields>
----------------------------------------------------------------------------
----------------------------------------
var xmlDoc;
xmlDoc = new ActiveXObject( "MSXML2.DOMDocument.4.0" );
xmlDoc.async = false;
xmlDoc.load( xmlFile );
but ... the error is occurred.
Invalid XML File!
File URL: ................
Line No.: 15
Character: 82
File Position: 533
Source Text: <my:field8 xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></my:field8>
Error Code: -1072897995
Description: xsi:nil attribute on element "my:field8" is invalid.
I can't understand why this document is "Invalid XML File".
the XML File can be loaded in .NET XmlDocument class and Internet Explorer.
but... MSXML2.DOMDocument.4.0 can't load.
Are there any problem that I don't recognize?
"Ryan" <no****@nospam.net> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
I have a very complex XDR schema that uses namespaces:
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes"
Do I need to build a custom validator in order to validate XML documents
against this schema? How does the XML parser know how to validate against
the extra namespaces?
For example, schemas-microsoft-com:datatypes allows for attributes such as
maxLength, minLength, etc. If my XML document contains a value that
doesn't meet these criteria, then the document should not be valid.
The "schemas-microsoft-com:BizTalkServer" is even more custom, allowing
for such things as a "FieldInfo" element with "format" attributes that
specifiy the exact format for dates and times. I'm pretty sure XmlValidatingReader
doesn't check for these special validations.
If I do have to build my own validator, does anyone have some samples I
can look at? Is there an easy way to do this?
Thanks, Ryan