How do I customize exported XML file?

G

Guest

Using Access 2003 I can easily export related tables to XML, however I need
to add additional element tags in the XML file to allow another custom
program to easily read in the XML file.

For instance, in the example below I need to add the "Entry" element tags to
the XML file. I can hand edit the file, however I would like to automate the
process - any ideas? thanks

<!-- Global Event Table -->
- <EventTable>
- <Entry>
<EventId>276</EventId>
<Enabled>1</Enabled>
<Priority>10</Priority>
<DataType>9</DataType>
- <Handler>
<DestNode>2</DestNode>
<Enabled>1</Enabled>
<DestTable>1</DestTable>
<DestId>7</DestId>
</Handler>
</Entry>
- <Entry>
…
</Entry>
</EventTable>
 
J

John Nurick

I'd do this either by

1) writing VBA code that works through a recordset generating the exact
XML needed and writing it to a file

or

2) using the built-in export routine and then writing code that reads
the file, inserts the additional tags and writes it back to disk. This
is simple if it's just a matter of inserting
<Entry> after each <EventTable>
</Entry> before each </EventTable>
and </Entry>
<Entry> after each </Handler>
but can easily get more complicated.
 
G

Guest

Thanks John, I'll try your 2nd suggestion.

John Nurick said:
I'd do this either by

1) writing VBA code that works through a recordset generating the exact
XML needed and writing it to a file

or

2) using the built-in export routine and then writing code that reads
the file, inserts the additional tags and writes it back to disk. This
is simple if it's just a matter of inserting
<Entry> after each <EventTable>
</Entry> before each </EventTable>
and </Entry>
<Entry> after each </Handler>
but can easily get more complicated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top