Jump to content

Export Multiple Tables to XML


This topic is 6115 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have seperate tables for each WBS level of a project (WBS Levels 4-8)

Each table will contain the same fields to be exported, and I need to create ONE XML file that contains all the records from all WBS levels.

What is the best way to get all these records into one XML file?

Thanks for any guidance!

Link to comment
Share on other sites

There is a document(relative file path) function in xsl, which can be used in an xsl stylesheet to import data from another xml file, other than the one being currently exported. So you could use your last xml export to assemble, insert and manipulate the data from the previous xml exports.

Link to comment
Share on other sites

Hi Fenton. Thanks for the reply. I am currently using an XSL to transform the data and create the tags.

So if I am understanding you correctly, on the last export, WBS 8, (say ive already exported WBS 4-7)I would modify the XSL to reference/insert the other XML files as well as export the last WBS?

Sorry, i am fairly new to XML. Do you know the correct syntax for doing this?

Thanks!

Link to comment
Share on other sites

I've not done it much myself, except just a quick experiment (a while ago), but from what I can tell, it is fairly simple. You can either use the document() function directly as the top of a node path, or you can set a variable to the document, then use that in node paths.

Say you have an xml file named "WBS_7.xml", in the same folder, whose root element is "widgets." In the WBS_4.xsl file (last export, top level?).

This would produce something like:

A widget name

You'll also want to look at the and elements also, which can bring in whole chunks of xml in one piece, with one command. Much easier than for-each, value-of. Copy-of is also known as "deep copy," and it gets pretty much everything, all children. Copy is known as "shallow copy," and just gets the element of the current node. And I just read that in a book :(-]

Link to comment
Share on other sites

This topic is 6115 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.