Exporting XML Using Schema (1 Viewer)

EzGoingKev

Registered User.
Local time
Today, 06:39
Joined
Nov 8, 2019
Messages
178
Good afternoon.

I use a program that builds a data set in an Access db and then converts that data into an XML file. I modify the data in the Access db and then go into the program and run out the XML file. I have to do this multiple times as we need different XML files.

The XML file is in a certain format which I believe is set by a schema. I want to run the files out of Access only so I skip some of the steps. I can assemble the data I need but do not know anything about schemas. Is there a way to "extract" the schema from an existing XML and use that?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 11:39
Joined
Sep 12, 2006
Messages
15,634
I actually find it easy to hardcode XML.
It's quite straightforward to produce the tag pairs for each query field.
 

EzGoingKev

Registered User.
Local time
Today, 06:39
Joined
Nov 8, 2019
Messages
178
I did some of the tag pairs in Notepad and saved it as an XSD file but I am not sure how to "connect" the two.

When I use Access's export feature I am not seeing where I can select my own schema.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:39
Joined
May 7, 2009
Messages
19,226
can the .xml file be imported i access using:

Application.ImportXML "theXMLFile.xml", acStructureAndData
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 11:39
Joined
Sep 12, 2006
Messages
15,634
What I mean is , I get a query that I want to turn into an xml file and have a code module do this sort of thing

Code:
open text file
write xml header
for each row
     write opening tag
     write name and value

     for each column
             write opening tag
             write name and value
             write closing tag
    next
   write closing tag
next
close file

if you want to group some of the columns into a sub assembly you can do this manually
I can't see that a schema would do much different to what you do manually. I would have thought a schema is just metadata for the above

If someone else has a schema ready done for the query you have, then it might save you work, but that's probably unlikely unless it's some sort of industry standard.

I've used ostensibly identical standard industry xml files that turn out to be different

One stored addresses like this
<delivery address>
<address line 1\>
<address line 2\>
<address line 3\>
<address line 4\>
<\delivery address>


the other stored slightly differently
<delivery address>
<street\>
<town\>
<county\>
<postcode\>
<\delivery address>


so you always had to carefully inspect the structure and make sure you understood precisely how the file was constructed. You just couldn't ever just make assumptions.
 
Last edited:

EzGoingKev

Registered User.
Local time
Today, 06:39
Joined
Nov 8, 2019
Messages
178
I have no experience exporting/building an XML file from Access. I am also not an Access wizard.

I am looking for specific and hopefully easy to follow instructions on how to do what I need to do.
 

Users who are viewing this thread

Top Bottom