简体   繁体   中英

Filemaker script - XML Import

I have XML files to import into Filemaker and I managed to create the XSLT file that works with Filemaker. I also have written a script that imports these XML files into my database. However, I can only get it to import with a "matching names" import order with "Add new records".

The "matching names" is fine but I'd like to "Update matching records in found set" with the "Add remaining data as new records" option. Is this possible or should I just get the XML into Filemaker in a "XML" table and then update records in a separate table?

I'm also storing my XSLT in a Filemaker global field and exporting the that field to create the XSLT file. It appears that Filemaker creates a UTF-16 file when it does this. That kind of surprised me. Am I looking at this wrong?

To set the mapping use fixed references to a sample XML and XSLT files. Enter them in the command options, then set up field mapping; it will parse the file and show you the fields (and sample data) so you can see what goes where. Once you're ready with the mapping, replace the references with variables.

You can also use both: add two lines, one with a variable, another with a fixed path, like this:

$xml
Samples/Sample.xml

FileMaker file references can have multiple paths; FileMaker will use the first valid one. When you run a script and set the $xml variable to some path, it will pick this path; when you edit the script, the variable will not be set, so it will skip it and use the hardcoded Sample.xml instead.

Yes, FileMaker saves text as UTF-16. You can still use it for XSLT, provided you specify the correct encoding. Alternatively you can store your XSLT files in container fields and save them with the same Export Field step. This way you can use any encoding (and any format; it's a very generic way).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM