XML query

R

rmorrison

Hi I am new to using XML, and have a bit of an issue. How do I define
how the XML file looks when I export a query from Access?
 
A

AnandaSim

Hi I am new to using XML, and have a bit of an issue. How do I define
how the XML file looks when I export a query from Access?

XML is a markup language:

http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-origin-goals

That means, it is a plain text file, it uses tags.

When you export a query from Access 2003 to XML, several files with
different purpose can be generated.

1. A file with .xml extension - this is a data file, tagged so that
the data has structure. You can look at it, but it is not presentable
like an Access Report or a grid like Excel / datasheet.

2. A file with .xsd extension - this is a schema file that describes
what the fields are, what type of data is in those fields.

3. A file with a .xsl extension. - this is a programming language file
- it contains layout skeleton in HTML and vbscript chunks. This file,
if it is fed to an engine that understands it, will take the .xml file
and produce a HTML webpage.

4. A file with a .htm extension - this is a combined file which
contains stuff from the .xsl file and the .xml file. It is intended to
be opened by Internet Explorer and will then IE will digest this
content and display a rough looking grid.

All four files can opened by notepad since they are plain text files
and you can see the plumbing of the files.

Discuss more?

Ananda
 
R

rmorrison

Thanks for the response. I need to export data from a query with a
particular structure for a website update. I have managed to export
the query to an .xml file, but the structure isn't right. How do I
tell Access what the structure should be?
 
A

AnandaSim

Thanks for the response. I need to export data from a query with a
particular structure for a website update. I have managed to export
the query to an .xml file, but the structure isn't right. How do I
tell Access what the structure should be?

The structure of the .xml file and the schema in the .xsd file are
preset by Access (I guess).

It is very common for people who work with XML files to carry out
transforms from one structure to another structure. Obviously a crude
transformation is possible with manual and persistent programming but
a higher level transformation (as you can see in the .xsl file and
the .htm file that is generated) can be done with XSLT programming.

There are lots of XSLT books and references and there are lots of XSLT
engines / programming tools that a programmer can use to carry out the
transform. Since XML is a W3C initiative, many of this info and tools
are even free or widely described on the web.

If you are not a programmer, then you need to look for an end user XML
transformation tool - I can't at the moment put my finger on a cheap,
desktop end user tool that does this for someone who is not a
programmer.
 
A

Armele look

Hi just saw your inquiry on the MS access help and figured that I would help
you out. I had the same problem. The following is the command



Application.ExportXML _
ObjectType:=acExportQuery, _
DataSource:="QueryName", _
DataTarget:="Where you want the file to go" & "\FileName" & ".xml"
Application.TransformXML _
DataSource:="Where the file is currently located" & "\FileName" &
".xml", _
TransformSource:="\Location of your XSL file" & "\Name of your XSL file"
& ".xsl", _
OutputTarget:="Where you want to export your data to " & "\The Name of
the New File" & ".xml"



Please not the XSL file must match the data source.


Good luck
 
Top