Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted (edited)

Hi Everyone,

Where to start...

Ok so I am starting to get a regular updated external data source supplied to me in the form of an XML file, after hours of head hurting it seems I need an XSLT in order for Filemaker Pro to import/recognise the data.

This is where the plane flies over my head and I'm lost on a lonely deserted island.

Does anyone have XML knowledge that they could lend and hand with?

I have a demo XML file if it helps?

Edited by Guest
Posted

Like you noticed, you need an XSLT. I suggest you get going with learning the XSLT syntax and ask questions whenever you get stuck. You'll find some links to info and tools on www.filemaker.comxml

The XSLT will need to convert your source XML into the XML grammar FM understands for importing (see "importing XML" in the FM help file).

If you have no interest in learning XSLT then you'll have hire someone to write it for you.

Posted (edited)

I don't mind hiring someone as this is getting fairly pressing, and I don't have the time scale to learn XML for this requirement.

Edited by Guest
Posted

You can go ahead and upload your xml file (zipped preferred). If it's fairly simple and we have time, we might start an xsl file for you.* Also if you do a search here in the Import/Export/XML forums you will see several examples. Though every one is slightly different the same principles apply. Both Wim and I have uploaded a few xsl files.

* I say "might," and "start," because it can be tedious with larger xml files. Sometimes the xml is not simple. It can be highly "nested", with several levels. This means much the same as a FileMaker file with many tables. And it means several xsl files, one for each FileMaker table, for each import. But xml is more ambiguous as to what exactly those levels might mean, and how they interconnect. Recent examples here of Final Cut Pro, and especially the "banking" ones come to mind. The latter being just about indecipherable due to their elements' names.

The best (and just about only) book on FileMaker xml is by Beverly Voth. It's for FileMaker 6, but not much has changed in the xml. (Don't know if she's planning an update.)

http://www.amazon.com/exec/obidos/tg/detail/-/155622043X?v=glance

Posted

Please see the link below, looking at the file its not that large.

http://rapidsharing.com/download.php?id=DA2A11FE

Just enter the code click submit wait 20 secs then press the download button that appears at the bottom.

Thanks

Posted (edited)

I can't get the download button to work. It's only a 4K file. Why don't you attach it here? It's kind of clunky here also. Preview (or Edit) your message. Click the Manage Files link. Then Choose File, the Add, then Finished.

[ Nevermind, I got it to work. Had to turn on Cookies AND turn off Popup Window Blocking. ]

Edited by Guest
Posted

OK, here's a partial solution. I did quite a few fields, but not all. I also did the 2 "child" tables, Quotations and Files. I imported them all into FileMaker, and linked them via the SourceID (which was my best guess as to parent ID, but I don't really know). I didn't do all the fields. That would take the fun out :-]

My xml/xsl editor, TestXSLT, was not terribly happy with the "ISO-8859-15" encoding of the xml, but it worked fine.

StorageMagazines.zip

Posted

Ok thanks I'll have a look at this when I have time as I really don't understand XML all that well.

It confuses me further that there were XSL files and no XLST.

Thankyou for all your help and hopefully this will help me learn XML further but as this particular XML needs to be completed by the weekend I guess I'm off to find a XML/Filemaker bod to do this as a one off for me.

Although with the future looking like I will need to import more XML data I will have to learn it :

Posted

When I say "xsl", I mean "xslt". XSL is a broader term. There's other branches of xsl, such as xsl-fo, but that's more to do with formatting, and I know little about it.

If you study the example I think you'll see every mechanism you need to import your files. There's a few places where they uses "attributes" (name="value" pairs). This is done with the method:

element/@attribute name

There's a couple places where you would need a separate XSLT :-) file to import "children" into a separate FileMaker table (Quotations, Files).

I didn't do all the "fields", nor script the Import XML steps. But that's mostly just more of the same.

It can be a little tricky sometimes figuring out (guessing) what's "one" and what's "many" in an XML file. Often they wrap what it is always "one" in an enclosing element. This opens the possibility (structurally) that there could many "sets" (my term) of that element. But often there's logically only 1 instance of that element; it's just their way of nicely wrapping the data in an understandable way.

Example:

64

2006-06-06

I assume that there's only 1 Publication, so I imported into the Article. But structurally they could add another Publication "set." is much the same.

Whereas this is obviously a child:

Cisco

Sun

But, what is: selected="1"? It must be Boolean.

The biggest problem, from a FileMaker point of view, is: What is the primary ID?? There's this:

(id is an attribute of Source)

But that is probably not sufficient to ID the article. Maybe, maybe not. It's important, because the children, Quotations and Files need a parent ID. Probably the best thing to do, in confusing cases, is to script it in FileMaker. Import the parent first, set its ID into a global (or Variable), then import the children, and Replace with the parent ID.

Posted

I just ran across this, a blog by Mikhail Edoshin (of "Smart Ranges" fame).

http://edoshin.skeletonkey.com/

A little ways down there are a couple of links to online XML tutorials, as well as a more intermediate example file of his. I'm going to check it out now :)-!

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