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.

How to extract information within tag

Featured Replies

Hi there,

I've setup an XSLT style sheet to import the contents of these XML branches into FM:

...

...

However I'd also like to import the id statements that are within the tags. How would I go about extending my XSLT style sheet?

Here is what I use, which aside from not importing the ids works perfectly well:

<?xml version="1.0" encoding="UTF-8"?>

0

Any input greatly appreciated!

Thx,

Edited by Guest

Those are called "attributes" (much like HTML). They are extracted by using the "@" sign. In this case you're already in their element's node, so you'd just use:


  • Author

Hi Fenton,

works like a charm. Thanks!

If I may bother you with another question: The XML source consists of two blocks, the first one:

...

...

...

and the second one that I quoted before:

...

...

I've set up the import routine twice, so I need to import the two blocks seperatly from each other using two different XSLTs.

Is there a way to do the job using only one XSLT and therefore only one import routine? The content of the header block (name, type etc.) is on a different level (first level within the block) though than the content that I need to extract from the topics block (second level within the block).

Thanks again,

You can always access levels above the node that determines what a FileMaker record is, but using the "../" syntax in the path, like "../../header/name" (pseudo code, test yourself, it's easy to have the wrong number of ../). But the question is whether you should. It's more of a database structural question, since bringing both in at once effectively "flattens" hierarchal data, bringing the same header data into each FileMaker record, rather than importing it into a "parent" table. But it could bring in the parent ID in any case, which can be used to tie the tables' data together.

  • Author

Hi Fenton,

you are perfectly right of course when saying that you loose the hierarchical structure of the data, but as of now (don't ask me why the customer chose to go that way) this is what the data should look like when imported into FileMaker.

However what is not intended is that every record of the child tree also has the data of the parent tree but the data should rather be imported into subsequent records within FileMaker. That means if the parent tree has got 3 records and the child tree 100 records after importing into FileMaker there should be 103 records.

Can something like this be accomplished (since in the end it means nothing else than triggering two import steps in FileMaker via XSLT)?

Best regards,

It's possible to do it all in one import, using a single stylesheet with multiple templates. Roughly, your main template would have (after METADATA):P


...

















Then two sub-templates would follow, something like:























...

Makes sure to leave empty COL elements in your sub-templates, so that your data maps to the correct fields.

  • Author

Thanks a lot! I'll check this out as soon as I get to - probably tomorrow morning.

Regards,

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.