Need code sample for XML scenario specified

ajaybabuChajaybabuCh Member Posts: 208
Hi I have one xml file Maps.xml which contains the following xml

NewDataSet>
<NAV_LINKED_TABLE_INFO>
<No>1</No>
<PrimaryFormName>Form Purchase Order</PrimaryFormName>
<LinkedFormname>Form Posted Purchase Receipt</LinkedFormname>
</NAV_LINKED_TABLE_INFO>
</NewDataSet>

I have decalred the following variables and written the code

XMLDom as 'Microsoft XML, v3.0'.DOMDocument
XMLNode as 'Microsoft XML, v3.0'.IXMLDOMNode

XMLDom.load('c:\Map.XML');

//xmlnode contains NAV_LINKED_TABLE_INFO
XMLNode := XMLDom.selectSingleNode('NewDataSet/NAV_LINKED_TABLE_INFO')

I want to append XMLNode to XMLDom so that I have to get the following result

NewDataSet>
<NAV_LINKED_TABLE_INFO>
<No>1</No>
<PrimaryFormName>Form Purchase Order</PrimaryFormName>
<LinkedFormname>Form Posted Purchase Receipt</LinkedFormname>
</NAV_LINKED_TABLE_INFO>
<NAV_LINKED_TABLE_INFO>
<No>1</No>
<PrimaryFormName>Form Purchase Order</PrimaryFormName>
<LinkedFormname>Form Posted Purchase Receipt</LinkedFormname>
</NAV_LINKED_TABLE_INFO>
</NewDataSet>

can anybody give me the code for this
Ajay

Comments

  • garakgarak Member Posts: 3,263
    The answer is the same linke in you post here

    viewtopic.php?f=23&t=31017

    take a look into the standard NAV Codeunits to understand the XMLDom communication.
    Also if you search the forum, you will find a lot of topics.

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.