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.
set objXMLDOMNode = objXMLDOMNode.insertBefore(newChild,
refChild)
Remark
This method inserts a new child Node before the current Node
(objXMLDOMNode).
From the methods signature, if you do not include a parameter,
refChild, then this function acts the same as the appendChild()
method. Here the refChild must be a child Node of the current
Node (objXMLDOMNode). This indicates that the new child must be
inserted before this refChild Node (which is the left
sibling).
The DOMDocument checks that the refChild is a child Node of
the current Node (objXMLDOMNode). If it is not, then an error
will occur.
This method returns the child that has been successfully
inserted. The method will return an error if you have tried to do
an impossible operation, such as adding a Node of type
NODE_DOCUMENT_TYPE (which cannot be a child Node), or the
refChild is not a child Node of the current Node. See the
nodeType property and the createNode() method for more
information on types of Nodes.
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!