Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Problem Validating XML Document

From: MartinL@-----------.---------.---
To: NULL
Date: 1/14/2009 4:50:00 AM
Hi Martin,

Thanks for the quick reply.  I made both changes as you suggested, but it 
did not have any effect - the XML that was created was identical to the 
original version of the code, and the error message still occurs.  What is 
even more bizarre is if I output the XML as a string right before I perform 
the first validation, the XML is perfectly fine (the schema declaration is 
there), but it still gives the message that the schema declaration was not 
found.

Regards,
Martin

"Martin Honnen" wrote:

> MartinL wrote:
> 
> >     Dim atrNSNode As IXMLDOMAttribute
> >     Set atrNSNode = xmlDocument.createNode(NODE_ATTRIBUTE, "xmlns:xsi", 
> > "http://www.w3.org/2001/XMLSchema-instance")
> 
> The namespace for namespace declaration attributes (i.e. xmlns:prefix) 
> is http://www.w3.org/2000/xmlns/ so the last argument above should be
>    "http://www.w3.org/2000/xmlns/"
> 
> Try whether that solves it, I haven't looked at the other code in detail.
> 
> 
> >     Set elmBook = xmlDocument.createElement("b:Book")
> 
> If you want to create XML with namespaces with MSXML then I strongly 
> suggest to use createNode as that is the only namespace aware method 
> that MSXML provides. So change _all_ those createElement calls to e.g.
>    createNode(1, "b:book", "http://foo.com")
> 
> 
> -- 
> 
> 	Martin Honnen --- MVP XML
> 	http://JavaScript.FAQTs.com/
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent