Read nested XML

Discussion in 'Tally Developer' started by Jyoti, Aug 9, 2019.

    
  1. Jyoti

    Jyoti New Member


    Hi
    I want to read this xml file but unable

    XML

    <?xml version="1.0" encoding="utf-8"?>
    <Purchorderlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
    <result>
    <Transpurchorder>
    <Docid>PORD 2018 00000004</Docid>
    <Pordid>1</Pordid>
    <Distid>427</Distid>
    <Partyname>ABB INDIA LTD</Partyname>
    <VDate>2018-05-14T13:49:05</VDate>
    <Remark>g</Remark>
    <createddate>2018-05-14T13:49:05</createddate>
    <purchorder1>
    <Transpurchorder1>
    <Docid>PORD 2018 00000004</Docid>
    <sno>1</sno>
    <itemid>11</itemid>
    <Quantity>1.00</Quantity>
    <Unit />
    <Rate>0.00</Rate>
    <VDate>2018-05-14T13:49:05</VDate>
    </Transpurchorder1>
    </purchorder1>
    </Transpurchorder>
    <Transpurchorder>
    <Docid>PORD 2018 00000005</Docid>
    <Pordid>2</Pordid>
    <Distid>427</Distid>
    <Partyname>ABB INDIA LTD</Partyname>
    <VDate>2018-06-20T13:54:23</VDate>
    <Remark />
    <createddate>2018-06-20T13:54:23</createddate>
    <purchorder1>
    <Transpurchorder1>
    <Docid>PORD 2018 00000005</Docid>
    <sno>1</sno>
    <itemid>96</itemid>
    <Quantity>2.00</Quantity>
    <Unit>1</Unit>
    <Rate>0.00</Rate>
    <VDate>2018-06-20T13:54:23</VDate>
    </Transpurchorder1>
    </purchorder1>
    </Transpurchorder>
    <Transpurchorder>
    <Docid>PORD 2018 00000006</Docid>
    <Pordid>3</Pordid>
    <Distid>505</Distid>
    <Partyname>AIRTEL</Partyname>
    <VDate>2018-06-24T12:01:24</VDate>
    <Remark />
    <createddate>2018-06-24T12:01:24</createddate>
    <purchorder1 />
    </Transpurchorder>
    <Transpurchorder>
    <Docid>PORD 2018 00000007</Docid>
    <Pordid>4</Pordid>
    <Distid>505</Distid>
    <Partyname>AIRTEL</Partyname>
    <VDate>2018-06-24T12:01:28</VDate>
    <Remark />
    <createddate>2018-06-24T12:01:28</createddate>
    <purchorder1 />
    </Transpurchorder>
    <Transpurchorder>
    <Docid>PORD 2018 00000009</Docid>
    <Pordid>6</Pordid>
    <Distid>505</Distid>
    <Partyname>AIRTEL</Partyname>
    <VDate>2019-02-06T11:27:21</VDate>
    <Remark>g</Remark>
    <createddate>2019-02-06T11:27:21</createddate>
    <purchorder1>
    <Transpurchorder1>
    <Docid>PORD 2018 00000009</Docid>
    <sno>1</sno>
    <itemid>11</itemid>
    <Quantity>50.00</Quantity>
    <Unit />
    <Rate>0.00</Rate>
    <VDate>2019-02-06T11:27:21</VDate>
    </Transpurchorder1>
    </purchorder1>
    </Transpurchorder>
    <Transpurchorder>
    <Docid>PORD 2018 00000010</Docid>
    <Pordid>7</Pordid>
    <Distid>505</Distid>
    <Partyname>AIRTEL</Partyname>
    <VDate>2019-02-06T11:54:07</VDate>
    <Remark>ggg</Remark>
    <createddate>2019-02-06T11:54:07</createddate>
    <purchorder1>
    <Transpurchorder1>
    <Docid>PORD 2018 00000010</Docid>
    <sno>1</sno>
    <itemid>96</itemid>
    <Quantity>50.00</Quantity>
    <Unit>1</Unit>
    <Rate>0.00</Rate>
    <VDate>2019-02-06T11:54:07</VDate>
    </Transpurchorder1>
    <Transpurchorder1>
    <Docid>PORD 2018 00000010</Docid>
    <sno>2</sno>
    <itemid>11</itemid>
    <Quantity>60.00</Quantity>
    <Unit />
    <Rate>0.00</Rate>
    <VDate>2019-02-06T11:54:07</VDate>
    </Transpurchorder1>
    </purchorder1>
    </Transpurchorder>
    </result>
    </Purchorderlist>

    Please give any suggustion



    My tdl code given below


    ---------------TDL Code Start here


    [Collection:Save Sale orders]
    Remote URL: "http://localhost:60549/And_sync.asmx/postpurchordertotally"
    XML Object Path:"Transpurchorder:1:purchorderlist:result:1"
    ;Fetch:Docid,PartyName,Pordid
    ; XML Object:purchase Data
    ; Search Key:$Docid
    ;
    [Collection:transpurchorder]
    Source Collection:Save Sale orders
    Walk:Transpurchorder
    By:Docid:$Docid
    By:pordid:$Pordid
    By:VDate:$VDate
    By:partyLedgerName1:$PartyName
    ;
    ; Compute:transorder1:$purchorder1
    [Collection:transpurchorder1]
    Source Var : masterdocid:string:$Docid
    Source Collection:Save Sale orders
    Walk:Transpurchorder,purchorder1,Transpurchorder1
    By:Docid1:$Docid
    By:itemid:$itemid
    By:qty:$Quantity
    By:Amount:1000
    Filter:Filterlinefile

    [Function:SaveSaleorders]
    Variable:mynar:String
    00: Set : SVViewName :$$SysName:InvVchView
    01 : WALK COLLECTION:Save Sale orders
    ;02 : Set:mynar:$Docid

    03 : NEW OBJECT:VOUCHER
    04 : SET VALUE:$VDate
    05 : SET VALUE : VoucherTypeName : $$String:$$VchTypeSalesOrder
    06 : SET VALUE : PartyLedgerName :$PartyName
    07 : SET VALUE : Narration : " Duplicated"
    1001:Set Value:BASICBASEPARTYNAME:$PartyName
    1002:Set Value:FBTPAYMENTTYPE:"Default"
    1003:Set Value:BASICBUYERNAME:$PartyName
    1004:Set Value:ISDELETED:No
    08 : SET VALUE : PersistedView : ##SVViewName
    09 : LOG TARGET : TgtObj.txt
    ;; Since the Methods Date, VoucherTypeName, Vouch
    10 : Insert Collection Object:LedgerEntries
    1008:Insert Collection Object:OLDAUDITENTRYIDS
    11 : SET VALUE : LedgerName : $PartyName
    12 : SET VALUE : Is Deemed Positive : "Yes"
    1006:Set Value:ISPARTYLEDGER:Yes
    1007:Set Value:REMOVEZEROENTRIES:No
    13 : SET VALUE : ISPARTYLEDGER :Yes
    14 : SET VALUE : Amount : $$AsAmount:$Amount* -1
    15 : SET TARGET : ..
    16 : Walk Collection:transpurchorder1
    17 : Insert Collection Object:InventoryEntries
    18 : SET VALUE:StockItemName:$itemid
    19 : SET VALUE : IsDeemedPositive: No
    20 : SET VALUE : ActualQty : ($$TgtObject:($$AsQty:$qty))
    21 : SET VALUE : BilledQty : ($$TgtObject:($$AsQty:$qty))
    22 : SET VALUE : Rate : ($$TgtObject:($$AsRate:"100"))
    23 : SET VALUE : Amount : $$AsAmount:$Amount
    24:Insert Collection Object:BATCHALLOCATIONS
    25:Set Value:GODOWNNAME:"Main Location"
    26:Set Value:BATCHNAME:"Primary Batch"
    ;27:Set Value:ORDERNO:$$TgtObject:$$String:"4"
    ;333:SET VALUE : OrderDueDate : $$DateRange:"01-04-2016":"01-04-2016"
    28:Set Value:DYNAMICCSTISCLEARED:No
    29:Set Value:AMOUNT:$$AsAmount:$Amount
    30:Set Value:ACTUALQTY:$$Negative:($$TgtObject:($$AsOutQty:$$AsQty:$qty))
    31:Set Value:BILLEDQTY:$$Negative:($$TgtObject:($$AsOutQty:$$AsQty:$qty))
    32:Set Target:..
    33 : END WALK
    34 : Create Target
    35 : END WALK

    36 : RETURN

    [System:Formula]
    Filterlinefile:$Docid1 = $$ReqObject:$Docid






    -------------TDL Code End Here


    Please help me as soon as possible
     


Share This Page