Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6458 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hello,

I'me trying to import an xml file to FileMaker using an xsl style sheet in order to match the fmpxmlresult grammar.

The data I want to import is a book made out of 6 chapters, structure looks like:

There are 6 fields in the fm database which are supposed to take the corresponding elements.

This content is exported as XML from QuarkXpress. In the xsl file if I use the element everything works perfect. However I have some nested tags in each node; those might be and for example.

Using the element erases all the nested tags which is not what I want. In order to prevent this, I replaced this command by which produces almost what I want:

What to see

North Coast

bla bla bla

Questions:

1. How can I remove this: ?

2. When trying to import that to FileMaker, I get an error because FileMaker sees all the nested tags which he can't map to its field.

Thanks in advance for your help, Guy

Edited by Guest
Posted

Fenton,

Many thanks for your reply! In my opinion, the code you've given doesn't work in my situation; as I understand it, this will import "ChapterNum", "Title", "Subtitle" and "Text" to corresponding fields in FileMaker. Is that right?

May be I didn't explain it right, but my FileMaker database has 6 fields named "Chap1", "Chap2", "ChapX", … Each chapter of the xml file should be imported to its corresponding field and should keep all nested tags inserted in the "ChapX" element.

The "Content" tag doesn't have only one "Text" or "Subtitle" element, there might be 1 or more.

Case my plan is not possible, do you know a command to convert xml tags to comments (like html comments) so that FileMaker doesn't consider them?

Many thanks for you help, Guy

Posted

In my opinion, fields like Chap1, Chap2... are poor relational design. I don't know who is responsible, you or Quark. What happens if a book has lots of chapters? It would make the the xsl long and tedious.

You could get the chapter data however, by specifying a particular chapter; ie.,

instead of:

Then get each chapter's title, etc.. It would be a lot of pretty much duplicate coding, pretty tedious.

For the multiple entries in the tag, you would want/need a separate xsl stylesheet, for just those. AND another table in FileMaker. You could copy/paste the one for the chapters, then modify it. Would a "subtitle" always have a "text" following? Because you'd have to use one or the other as the selection; so they'd best be one-to-one.

But once again, the poor relational design makes it a problem, as there is no actual data to tie each to its chapter properly, and each chapter would have to coded again. It could likely still be done somehow, by reaching up and getting the name() of the chapter tag.

All and all, it's a good example of why poor relational* design causes problems, even though , may seem simple at first.

*Now I've said it 3 times :)-|

This topic is 6458 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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