domb Posted January 17, 2010 Posted January 17, 2010 (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 January 17, 2010 by Guest
comment Posted January 17, 2010 Posted January 17, 2010 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
domb Posted January 17, 2010 Author Posted January 17, 2010 (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 January 17, 2010 by Guest
Fenton Posted January 17, 2010 Posted January 17, 2010 You need 2 xsl stylesheets. One for the Product itself, the 2nd for the "compositions". But yes, you need the PRDNO in the child table. To get it you just "reach up" one level. Product_Comp_fej.xsl.zip
domb Posted January 17, 2010 Author Posted January 17, 2010 You are both great ! Thanks for your help.
domb Posted January 18, 2010 Author Posted January 18, 2010 (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 January 18, 2010 by Guest
Fenton Posted January 18, 2010 Posted January 18, 2010 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.
domb Posted January 18, 2010 Author Posted January 18, 2010 (edited) Here it is again. ... Strange I cannot attach files to my messages anymore... Here is a Link Edited January 18, 2010 by Guest
comment Posted January 18, 2010 Posted January 18, 2010 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.
Fenton Posted January 18, 2010 Posted January 18, 2010 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.
domb Posted January 18, 2010 Author Posted January 18, 2010 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: ….
domb Posted January 19, 2010 Author Posted January 19, 2010 Perfect ! Thanks again for your time and knowledge in this.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now