dcsimg
Merging multiple XML documents and need to get the value of a node without having special characters interpreted
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Larry_McKay
Posted On:   Wednesday, July 31, 2002 07:53 AM


Example: When I use Node.getNodeValue() it will interpret &amplt; as a less-than sign ( <). I need to get the node's value exactly as the text reads without interpretation. Otherwise, when I merge multiple xml documents, the resulting document will not be valid XML. Does anyone know of an easy way to do this?

Re: Merging multiple XML documents and need to get the value of a node without having special characters interpreted

Posted By:   John_Ninan  
Posted On:   Wednesday, July 31, 2002 04:14 PM

try this,

Private Sub Command1_Click()
' In the ProgIDs below, change 30 to reflect the installed version of the Microsoft XML Parser.
' For example, use Dim doc1 As MSXML2.DOMDocument40 for MSXML 4.

Dim doc1 As MSXML2.DOMDocument30
Dim doc2 As MSXML2.DOMDocument30
Dim doc2Node As MSXML2.IXMLDOMNode

Set doc1 = New MSXML2.DOMDocument30
Set doc2 = New MSXML2.DOMDocument30

doc1.Load "xmlbook1.xml"
doc2.Load "xmlbook2.xml"

For Each doc2Node In doc2.documentElement.childNodes
doc1.documentElement.appendChild doc2Node
Next

MsgBox doc1.xml

doc1.save "AllXMLBooks.xml"
End Sub
About | Sitemap | Contact