Hi there
I have a problem extracting XML content, and insert it into a Navision table.
The code looks like this:
XMLDocument.loadXML(RecordSet2.Fields.Item(xmlstring).Value);
XMLNodeList := XMLDocument.getElementsByTagName('CUBE/khoved'));
XMLNode := XMLNodeList.item(0);
REPEAT
MESSAGE(FORMAT(XMLNode.nodeTypedValue));
XMLNode := XMLNodeList.nextNode; // Next Node Element
UNTIL ISCLEAR(XMLNode);
I've created the following automation variables:
Name DataType Subtype
XMLDocument Automation 'Microsoft XML, v4.0'.DOMDocument
XMLNodeList Automation 'Microsoft XML, v4.0'.IXMLDOMNodeList
XMLNode Automation 'Microsoft XML, v4.0'.IXMLDOMNode
The XML-string looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<CUBE>
<khoved>
<khoved_id>10001</khoved_id>
<khoved_mindeltagere>0</khoved_mindeltagere>
<khoved_maxdeltagere>0</khoved_maxdeltagere>
</khoved>
</CUBE>
I need to extract all the tag-names (NodeName) and the values (nodeTypedValue), so I can insert them into a Navision table.
My problem is that when I write: XMLNode.nodeTypedValue I get all values in a long row. The XML-string has only one node (khoved) and several childnodes. How can I loop through all childnodes and extract the values?
Thank you in advance
/René
Comments
Have a look a this
http://www.mibuso.com/forum/viewtopic.php?t=8470
Regards
Thomas
Thanks, that was what I needed ;-)