Exporting To XML File

  • Thread starter Thread starter PC Datasheet
  • Start date Start date
P

PC Datasheet

AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML file
so all the file contains is data?

Thanks!

Steve
 
I suspect that what you are seeing is "well-formed XML" -- why would you
want to eliminate any part of it to make it "not-so-well-formed"? Does it
not import properly into the target application, and you have determined
that it is these particular markup items that prevent it doing so?

If all you want is data, you could use comma-delimited text (aka
comma-separated-variable, CSV) instead.

The only reason to use XML, generally, is that the data is going to an
application that accepts XML. Otherwise, you'd want to export in some other
format.

Larry Linson
Microsoft Access MVP
 
PC Datasheet said:
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file begins
with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the XML
file so all the file contains is data?
Hi Steve,

One small part of my job is to take University
Line Schedule data and print a report to a pdf
file. I use pdf995 which allows adding Bookmarks
after report has printed if they are in a "xml" file
which is not "well-formed."

As I print the report, I save Page number,
College, and Dept in a table.

I then run a function that writes this data
to the "xml" file in form they require by
opening a file for output, cycling through
a recordset to table above, and printing
lines to the file.

So...it's not difficult to "do-it-yourself."
If you'd like, I could post the code, but
the "form" of the output is specific to
pdf995 bookmarks.

I'm curious though as to how you would expect to
"header" a record in your xml....

gary
 
PC Datasheet said:
AccessXP in 2000 mode.

I am running a procedure using Application.ExportXML. The XML file
begins with:
<?xml version="1.0" encoding="UTF-8" ?>
- <dataroot xmlns:od="urn:schemas-microsoft-com:officedata">
- <QryExportWOOnSelectedShowDate>

Actually, the dashes that precede the tags are an artifact of Internet
Explorer, reflecting the expansion of a hierarchical node structure --
they aren't in the XML file itself, as you'll see if you edit it in
Notepad.
and I get the following between each record's data:
<QryExportWOOnSelectedShowDate>
-<QryExportWOOnSelectedShowDate>

Does anyone know if there is a way to prevent these entries in the
XML file so all the file contains is data?

Those tags, which I expect are really <QryExportWOOnSelectedShowDate>
.... data elements ... </QryExportWOOnSelectedShowDate>, are required by
the XML structure. Each pair marks the beginning and end of an element
of the document being represented by the XML file. In this case, the
element is a record. You can't get rid of them and still have a
well-formed XML document.
 
First, thanks to all of you!

I'm taking a shortcut here ---

WHAT ARE the big uses of XML? What are the advantages?

Thanks,

Steve
 
One use I'm seeing more and more of is as a replacement for INI files, since
it allows you to organize the data much easier. In situations where you have
multiple possibilities for a particular value, XML allows you the equivalent
of an array, which (assuming your program checks for the possibility) is
easier than having to check multiple keys.

It's also more reliable for simple text data than csv or fixed-width.

Overall, though, I find it tends to be more "verbose" than the alternatives.
 
Back
Top