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

XML import problem (xslt looks fine)


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

Recommended Posts

Posted (edited)

Hello,

I would like to import a XML file in Filemaker. So I created with the help of this link and this wonderfull template: http://edoshin.skeletonkey.com/2005/10/use_modular_xsl.html a xslt file to convert to FMXMLRESULT syntax.

It seems to work as I don't have any error messages but the import still doesn't work (0 record imported) for an unknown reason.

Attached to this message is a zip with the 4 necessary files:

- Medindex.fp7 --> the filemaker database in which I wish to import the XML data

- Medindex_Product.xslt and FileMaker.xslt --> files needed for the conversion to FMXMLRESULT syntax

- DownloadMedindexProduct.out.xml --> an extract of the xml file I wish to import

Can someone with knowledge in xml import and xslt help ?

Thanks

import_XML.zip

Edited by Guest
Posted

The real issue here is that the source XML document uses its own namespace. Splitting the stylesheet into two is IMHO an unnecessary complication that only makes it harder to find the problem.

The attached stand-alone stylesheet shows how to deal with the namespace.

med.xsl.zip

Posted (edited)

Hi and thank you very much for your help. It works well now !

I still have a question: in the XML file, there are some tags that appears many times for the same base tag. Example: in my XML file, tag "PRDNO" is the unique ID number for a product. A product can have many "composition items" represented by the "PRDCOMP" tag.

Of course, so that I can reproduce the link between a Product table and a Product_Composition table in Filemaker, I have to import the content of tag "PRDCOMP" in another table which I am now able to do.

BUT how do I import also the PRDNO in this table so that I can link these to my products ?

I tried to modify the xslt code but it doesn't work (see attached file)

Product_Composition.xsl.zip

Edited by Guest
Posted (edited)

Hello again,

With you help I was able to import most of my XML files into Filemaker and everything is working smoothly.

I still have one problem with one XML file whose syntax is quite different than the others.

I don't understand its structure very well (specially the at the end).

It is supposed to be text describing products. The product is linked to the text by the MONID number.

- each "KMP" element has its unique identifier MONID

- each "KMP" element has a type of documentation MONTYPE

- each "KMP" element has its language identifier LANG

- each "KMP" element contains text subdivised by sections (header, paragraph, footer)

With my xslt creation tentative I am able to import parts of the XML file but not all of it (not all paragraphs and not the MONTYPE, LANG items for instance).

In the attached file, I have put also the xsd file for the xml file to help the understanding of the structure.

Can you help me again ?

Edited by Guest
Posted

I am unable to download the file. It says it does not exist. Tried a few times (hence multiple views). Maybe it's just me, but I doubt it.

Posted (edited)

Here it is again.

...

Strange I cannot attach files to my messages anymore...

Here is a Link

Edited by Guest
Posted

To import the MONTYPE, use:

I am not sure how you want to import the paragraphs - there are quite a few of them, some have text formatting attached to them, and I've even seen a HTML table in there.

Posted

Neither the modid or version is inside a p, so that is not needed. To copy all the paragraphs, you could use this:

But it is a large block of text, with some returns, with some repetition. Perhaps could be done with more organization.

Posted

Hi,

This works but as you said it imports all the text into one field in a rather "brute" formatting.

I have noticed that each paragraph has got a name and id number. Is it possible to go after each paragraph number to put each one of them into another field ?

That would clean a little bit the text and be fine for me

Something like:

….

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