Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
3093
loadXML()
Is a member of:
DOMDocument
Syntax
blnValue = objDOMDocument.loadXML(xmlString)
Remark
When you call the loadXML() method for a DOMDocument, any
existing contents in the DOMDocument are discarded.
This is one of the two common ways to load XML into a
DOMDocument (see the load() method). In the loadXML signature,
xmlString is either a string that is an entire XML document or a
well-formed fragment.
True or False is returned to indicate success or failure of
the load.
loadXML bug in
XML 2.0
In the Microsoft XML 2.0 object, there is a bug in the
loadXML() method. Unfortunately, when used from VB or VBScript,
your code may return an error that says that there is a parse
error. The error usually complains that you are using an element
in your XML that is not declared in the DTD you have
referenced.
The error looks something like this:
The element "PEOPLE" is used but not declared in the
DTD/Schema.
The reason is that the loadXML() method, when called from VB
or VBA, will always act as if the resolveExternals property of
the document was false. There is no work-around, but it will be
fixed for the next release of the Microsoft XML objects.
This manuscript is an abridged version of a chapter from the
Manning
Publications book XMLProgramming with VB and ASP. This chapter
looks at the Microsoft DOM objects. NOTE: Most images have been
removed to increase speed and many of the code comments have also
been removed for presentation. Please purchase the book to enjoy
the full experience of all the chapters with images and code
comments!