1.11M Members

Adding data to xml file

 
0
 

Morning,

I am new to xml with delphi.
My problem is that i know how to build am xml file, the output is something like this:

**<EXPORT>
<IMPORTMODEL>1</IMPORTMODEL>
<SESSION></SESSION>
<STARTDATE>26-01-2011</STARTDATE>
<ENDDATE>26-01-2011</ENDDATE>
<VOUCHERS>
  <VOUCHER>
    <AUTHOR> X </AUTHOR>
    <INPUTDATE>1/23/2013</INPUTDATE>
    <REFERENCE>M1000009</REFERENCE>
    <ONDUPLICREF>N</ONDUPLICREF>
    <JOURNALTYPE>STANDARD</JOURNALTYPE>
    <DESCRIPTION>This is a test for the description of the voucher upon import</DESCRIPTION>
    <DOCLINE>
      <AUXIL>
        <CODE>1000</CODE>
        <NAME>test for new name for 1000</NAME>
      </AUXIL>
      <LABEL>This is a test for the label of the auxiliary account line</LABEL>
      <CURRENCY>USD</CURRENCY>
      <AMOUNT>100</AMOUNT>
      <CVBASE>100</CVBASE>
      <CVLOCAL>150750</CVLOCAL>
      <VALUEDATE>1/23/2013</VALUEDATE>
    </DOCLINE>  
  </VOUCHER>
</VOUCHERS>
</EXPORT>**

i am trying to export financial transactions to an accounting software, i need to save transactions and save them in one xml file, all transaction shall be added as a new line in **<VOUCHER> **tag.

How this can be done?

 
0
 

What method are you using to build the XML, the MSXML DOM tools?

 
0
 

yes i am

 
0
 

i need each voucher tag to be inserted from sql table row.
The uppers tag are static they will not change.
Like for example if i have 5 rows in the table i shall get 5 voucher tags.

Hope it is clear.

 
0
 

For each row create a new node, and then insert it using the DOM functions.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article