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

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

Recommended Posts

  • Newbies
Posted

Hello,

I am trying to import the attached XML file into FileMaker. My understanding is that I need a FileMaker compliant xslt file to do that. I am trying to find-out if there is an easy way to produce an xslt from the xml file. I used XMLFox Advance (an xml editor that reads xml files as relational databases) and created the attached xslt for my xml file, however it does not work when I try to open xml file in FileMaker using this xslt. I think it needs some modification to be compatible as a FileMaker accepted xslt. Or maybe it just doesn't work that way and I need to write an xslt form scratch.

I would appreciate any help/suggestion I can get.

Many thanks,

Ben

Files.zip

Posted

Well, the XSL it cranked out was for producing a web page. This is entirely different from FileMaker XML, which requires a specific result, matching its FMPXMLRESULT schema. There are several examples here on FMforums.

Not only must the xsl produce FileMaker-specific xml, but every xml data source is different, requiring an xsl stylesheet to fit, for import anyway. To think otherwise is naive. It would be like saying, "Here is my multi-table FileMaker solution for abc type of business. Import it into your independently-created solution, without even specifying which table goes into which, or fields or anything." Yeah, a mess.

Looking at your xml data I don't see any great problems. Except that the 1st scan "record" seems different from the subsequent ones. Not a big problem for xsl, as it can treat the 1st scan differently than the others. But it brings up database questions, about whether that "scan" should even in the same table as the others.

Basically you need to import xml just like any relational database, 1 table at a time, 1 xsl stylesheet per each, specifying the fields, specifying what you want. It is not really all that complex, but would be a bit tedious; you've quite a few fields here.

Hopefully you've already got a FileMaker database, with tables and fields that match this xml structure. Otherwise it would need to be built. In that case FileMaker could build it for you during the imports, 1 per table, each with its own xsl stylesheet.

Posted

This gives you an idea of how to start. This xsl will get you the basic patient (repetitive) and scan info, into a Scan table. But the scans begin to diverge greatly at the element. You'd definitely need another xsl for:

Despite the , these are likely different tables.

These are only in the 1st Scan record. So you would get them like this:

Here are some files to get you started. But really only started.

Scans_files.zip

Posted

P.S. In case you're wondering why I brought in so much "redundant" data. With most hierarchical xml files there are usually not relational IDs in the different levels of the data. XML doesn't need IDs, because the tree structure groups the data by its place. But since we're going to import the different levels into separate tables we need a way to tie them together.

The import process itself helps, in that newly imported data is the found set. So one can use a Loop to put parent IDs into child records. But, just in case, I was bringing in the PatientID, the ScanType, the Visit timestamp (as text, needs to get converted to a FileMaker timestamp). This info should be able to tie a DiscBoundary record to its parents. But it's probably not needed. When it gets into FileMaker you'd want to use real FileMaker IDs anyway.

  • Newbies
Posted

I really appreciate for your effort in response to my post. I will examine your reply and the files throughly. I will report how it goes.

Many many thanks.

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