Jump to content

Help needed with importing XML file which includes 2 tables


Carl Smith

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

Recommended Posts

Like most enquiries in this forum I'm very new to XML/XSLT etc. I've read through most of the recent topics regarding XML importing but can't locate any that covers my problem.

I'm getting a third-party XML (web shopping basket order)which includes data from 2 tables (e.g. Order Details & Order Items). I know that I will have to create 2 XSLT files for each part of the XML file. My problem is that I don't fully understand how I create the XSLT to cater for XML file the way it has been supplied.

Anyone out there who may be able to help?

I've added an example XML file based on the data I'm likely to get

Orders.zip

Link to comment
Share on other sites

There are a lot of elements here, and, as you say, 2 tables, hence 2 xsl stylesheets. But otherwise is fairly simple. There's only 2 levels, order or order item. And they nicely add the order id again in the order item level (which is not necessary, but it makes it a little easier). These 2 xsl files will import it. You'll need to add all the rest of the fields however.

Orders.xsl.zip

OrderItems.xsl.zip

Link to comment
Share on other sites

Hi Fenton

The files are exactly what I needed. I'm am extremely grateful and very much appreciate your quick response.

Asking another question: when viewing the Metadata section am I correct to assume this is the area that I should list all the relevant fields in the database that I'm importing into?

Link to comment
Share on other sites

Yep, those are what you see in the FileMaker Import dialog, for import order. Each has its own type also, Number, Text, Date, etc.. Though I don't really know what happens if you get one wrong; probably not much.

You shouldn't assume that what the xml calls a "date" is necessarily a FileMaker date; usually the xml data is text, and you post-process or auto-enter with calculation to get a real FileMaker date or timestamp.

When you use FMPXMLRESULT grammar (which you must to import), the Metadata s must be in the same order as the in the . Otherwise your data will go into the wrong field.

Link to comment
Share on other sites

This topic is 6311 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.