Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML into filemaker - no validation errors

Featured Replies

Hi everyone,

Is it possible or are there any tools that can validate data imported into filemaker from an xml file

For example say I have a Contact table with fields:

CONTACT:

company

fname

lname

After I export this into xml the xml file would contain nodes company, fname and lname.

Sometime later my database schema changes and fields fname and lname are renamed to first_name and last_name

Now if I import the original xml file with nodes fname and lname the import will still work without any errors thrown from filemaker and only company will be imported since fname and lname fields no longer exists in the database.

I understand I could create an xsd to validate the xml file coming in but let's say the xml schema hasn't changed and it still expects fname, lname and company.

So is there are a way for filemaker to throw an error when not all of the xml nodes are mapped i.e. when I created the import scripts nodes required were fname and lname. It's just too hard to identify all of these fields changes and update the xsd schemas every time something changes in the database. Would be nice if there were some errors thrown when the xml no longer conforms to the mapping based in the import script. It's a major problem and these sometimes go undetected. System has over a 1000 scripts and over 150 tables.

Any thoughts would be helpful

Thanks,

Dali

I don't have an answer for throwing an error other than using a third-party tool or a plug-in that provides XML utility (e.g. SmartPill PHP or ScriptMaster).

But you might consider the option of modifying your XSLT files to recognize the changes in the files using conditionals. Either solve the translation problem directly in XSLT or log its findings to a FileMaker field that you reliably import.

Another thing to consider is to add a tag or version="" attribute to be required in your XML document. You can then check the version independently of importing all of the data. Obsolete formats would then either lack the version information or would have an earlier version number.

Edited by Guest

is there are a way for filemaker to throw an error when not all of the xml nodes are mapped

Well, the thing is that your existing XSLT stylesheet still HAS those nodes - so they ARE mapped correctly in the import dialog. The problem is that they are empty.

I am not sure it's possible to properly validate the source XML against a schema during the XSL transformation stage (I believe the parser DOES validate, if there is a DTD included/referenced in the XML document - but of course that would be the NEW schema). However, you could do your own "pedestrian" validation, and generate records only if all tests passed. If there are no records, nothing will be imported - and you will get an error message.

  • Author

Thank you for your replies,

I use command tools to validate against xsd schema and handle xslt 2.0 transformations so no hiccups there.

Could you give little more detail regarding your comment. Not really sure what a "pedestrian" validation is. What's the best way for testing data importing/migration?

"However, you could do your own "pedestrian" validation, and generate records only if all tests passed. If there are no records, nothing will be imported - and you will get an error message.

I use command tools to validate against xsd schema and handle xslt 2.0 transformations so no hiccups there.

I am afraid I don't follow: if you validate against xsd schema and the source doesn't conform, then it should fail right there - and no attempt to import should take place. I thought you were importing directly into Filemaker, using a stylesheet to transform the source during the import.

Not really sure what a "pedestrian" validation is

For example:

...

This will create records only when a element exists as a child of .

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.