LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

createCDATAsection with MSXML in LabView?

Hi everybody,
 
I have a problem using MSXML DOM in LabVIEW. After I have created a CDATA node filled with Data, I can't append this node as a child node to a parent node.
 
MSDN provides a solution in Visual Basic:
 
Dim xmlDoc As New Msxml2.DOMDocument30
Dim root As IXMLDOMElement
Dim CDATASection As IXMLDOMCDATASection
xmlDoc.async = False
xmlDoc.loadXML "<root><child/></root>"
If (xmlDoc.parseError.errorCode <> 0) Then
   Dim myErr
   Set myErr = xmlDoc.parseError
   MsgBox("You have error " & myErr.reason)
Else
   Set root = xmlDoc.documentElement
   Set CDATASection = xmlDoc.createCDATASection("Hello World!")
   root.appendChild CDATASection
   MsgBox (root.xml)
End If
 
How can I transfer this solution is LabVIEW? When I try this, I cannot use the output of the createCDATAsection as input for the appendchild method.
Any help would be appriciated. I google'd and searched this forim without success.
Thanks
0 Kudos
Message 1 of 3
(3,263 Views)
Hi,

try it with a typecast like in my attached example.

regards

Marco Brauner NIG
Download All
0 Kudos
Message 2 of 3
(3,255 Views)
Hi Marco,
 
thanks for this solution, it looks very interesting. However, meanwhile I have found another way for this problem:
 
First you should create the parentNode as a normal NODE_ELEMENT. After that create a Node as NODE_CDATA_SECTION and append it as a childnode. Now we can use the simple text property to write the data formatted in CDATA.
 
I have attached the solution.
 
Anyway I will test your solution, because it looks very interesting 🙂
0 Kudos
Message 3 of 3
(3,244 Views)