Modify External XML Document

  • Thread starter Thread starter Dataman
  • Start date Start date
D

Dataman

Using ACC2003 and exporting a query as a xml file. When I do this, the file
looks like this:
--------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<dataroot xmlns:od="urn:schemas-microsoft-com:officedata"
generated="2008-01-23T14:54:12">

<DMRValuesItem>

<DMRRptId>263999</DMRRptId>

<DMRValId>6416445</DMRValId>

<PermitNum>WY0001234</PermitNum>

<Outfall>2341</Outfall>

<SBCode>cDX</SBCode>

<ParamID>30</ParamID>

</DMRValuesItem>

</dataroot>

------------------------------------------------------------------------------

The first two lines need to be removed and replaced with the
"<DMRValuesSet>" string right above "<DMRValuesItem>" string

The last line "</dataroot>" needs to be replaced with </DMRValuesItem> above
"<DMRValuesSet>"

The finished document should look like this:

<DMRValuesSet>

<DMRValuesItem>

<DMRRptId>263000</DMRRptId>

<DMRValId>6477739</DMRValId>

<PermitNum>WY0012345</PermitNum>

<Outfall>035</Outfall>

<SBCode>cDX</SBCode>

<ParamID>30</ParamID>

</DMRValuesItem>

</DMRValuesSet>

After I export the document I need to programmatically modify the document
as show above. I alread have the filename and path as a variable. This
document MUST be formatted as shown in the second example.

If someone has a code example please post it.

Thanks in advance for any help offered.

DM
 
Back
Top