Need sample code to traverse records using XML DOM

ajaybabuCh
ajaybabuCh Member Posts: 208
Hi

Can anybody give me the code to traversse through records in an xml format using XML DOM
Ajay

Comments

  • garak
    garak Member Posts: 3,263
    Take a look into the Cu that has XML in his name (line XML DOM Management) ;-)
    Do you make it right, it works too!
  • ajaybabuCh
    ajaybabuCh Member Posts: 208
    hi garak
    can you give me some link for this.

    I couldn't find proper example for my scenario.

    If I have number of records in my XML , how to read those records one by one using XML DOM
    Ajay
  • garak
    garak Member Posts: 3,263
    Did you take a look into the CU and how this is called from oter CU?
    Do you make it right, it works too!
  • ajaybabuCh
    ajaybabuCh Member Posts: 208
    Yes, But I am not really clear how to use that

    Assume that I have the following format of xml , which contains all the sales header records

    <HeaderLines>
    <SalesOrder>
    <No.>SO100</No.>
    <SelltoCustomerNo>10000</SelltoCustomerNo>
    <CustomerName>Selangorian Ltd.</CustomerName>
    </SalesOrder>
    <SalesOrder>
    <No.>SO101</No.>
    <SelltoCustomerNo>10000</SelltoCustomerNo>
    <CustomerName>Selangorian Ltd.</CustomerName>
    </SalesOrder>
    <SalesOrder>
    <No.>SO102</No.>
    <SelltoCustomerNo>10000</SelltoCustomerNo>
    <CustomerName>Selangorian Ltd.</CustomerName>
    </SalesOrder>
    <SalesOrder>
    <No.>SO103</No.>
    <SelltoCustomerNo>10000</SelltoCustomerNo>
    <CustomerName>Selangorian Ltd.</CustomerName>
    </SalesOrder>
    </HeaderLines>

    I would like to load this through XMLDOM and want to traverse each order.
    can I have some sample code for this
    Ajay
  • DenSter
    DenSter Member Posts: 8,307
    Take a look at the Biztalk codeunits in a standard 3.7 database. XML is now imported using XMLPorts, so XMLDOM is not used very much anymore. The old versions have excellent examples of how to use XMLDOM.