Filemaker script - Import XML

I have XML files to import into Filemaker, and I managed to create an XSLT file that works with Filemaker. I also wrote a script file that imports these XML files into my database. However, I can only import it with the import "name matching" with "Add new entries".

The “matching names” are fine, but I would like to “Update matching records in the found set” with the option “Add remaining data as new records”. Is this possible or should I just get the XML in Filemaker in the XML table and then update the records in a separate table?

I also store my XSLT in the global Filemaker field and export this field to create the XSLT file. It appears that Filemaker creates the UTF-16 file when it does. It surprised me. Am I looking at it wrong?

+4
source share
1 answer

To set the mapping, use fixed links to sample XML and XSLT files. Enter them in the command parameters, then configure the field mapping; it will analyze the file and show you the fields (and sample data) so you can see what is happening. When you're ready with the mapping, replace the variable references.

You can also use both: add two lines, one with a variable, the other with a fixed path, for example:

$xml Samples/Sample.xml 

Links to FileMaker files can have several paths; FileMaker will use the first valid. When you run the script and set the variable $xml to some path, it will select that path; when you edit the script, the variable will not be set, so it will skip it and use hardcoded Sample.xml instead.

Yes, FileMaker saves text as UTF-16. You can still use it for XSLT if you specify the correct encoding. In addition, you can store XSLT files in container fields and save them with the same export field step. This way you can use any encoding (and any format, this is a very general way).

+1
source

Source: https://habr.com/ru/post/1445091/


All Articles