Read XML file in Axapta

aip00aip00 Member Posts: 5
edited 2005-06-20 in Dynamics AX
I have the following code in the XML file
<sale>
<base>

<SKU>128892</SKU>
<descr>CROSS 10K BP </descr>
<extPrice>25.99</extPrice>
<unitPrice>25.9900</unitPrice>

</base>
</sale>

There are spaces in the <descr> node. When I read the file I have the following code:
lineNodeList = _xmlDoc.getElementsByTagName('sale');

Then I wrote a special function to turn the Node List into a container:
(xml_str is a string field; i is the counter in a FOR loop;
lineCon is a container; function Specialstr2con is similar to function str2con)
xml_str = lineNodeList.item(i).getNodeValue();
lineCon = Specialstr2con(strlrtrim(xml_str), ' ');

If I use the 'space' as a separator for the string, I read the <descr> node in multiple container 'space'. How can I avoid this? Can I convert a node list into a container?
Sign In or Register to comment.