Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Problem Validating XML Document [Thread Next] Re: Problem Validating XML DocumentTo: 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/
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
