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

Repeating fields import from FMPXMLRESULT in FMP6


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

Recommended Posts

Posted

How can i import XML data into repeating fields in FM6? I was able to export repeating fields to XML in FMPXMLRESULT grammar, and it looked like this:


...

  <RESULTSET FOUND="1">

    <ROW MODID="1" RECORDID="1">

      <COL>

        <DATA>some data</DATA>

        <DATA>different data</DATA>

        <DATA></DATA>

        ...

      </COL>

    </ROW>

  </RESULTSET>

...



But i wasn't sure of its usefulness.  Additionally, immediately after exporting this file (without a stylesheet) i try importing it (again, without a stylesheet--no transformation is needed, because it's FM's native grammar, right?) and wind up with only the first repetition populated, with data from the first <DATA> element.



My issue is that i have other (non-FM) XML that looks like:



...

<elementtypeA>

  <elementtypeB>some data</elementtypeB>

  <elementtypeB>different data</elementtypeB>

</elementA>

...

And i want to import each of the elements <elementTypeB> into one repeating field, so that the first repetition contains "some data" and the second repetition contains "different data." But before i can get to writing an XSLT, i need to understand how FMPXMLRESULT imports repeating fields.

Any ideas on where to look for examples of such a feat? FM's documentation claims that repeating fields can be used with XML, but does not explain how.

Jerry

Posted

But before i can get to writing an XSLT, i need to understand how FMPXMLRESULT imports repeating fields.

It is not possible to import data into other repetitions than the first.

FMP will export a repeating list correctly, but will bring in only the first data element on import.

Posted

Thanks, Jean-Marie. I was afraid that would be the answer. You don't, by chance, have any strategies for working around this issue, do you? I'm thinking of something along the lines of somehow combining all the sibling elements prior to the import, and separating their values with some sort of delimiter. This is not ideal, though, as the values i would be combining may be very long text strings in some cases.

Do you know of any better ways than this?

J

Posted

"separating their values with some sort of delimiter"

Considering an xml :

attachment : repeating.xml

(sorry, the "code" UBB Code will not work for me)

the xsl :

attachment: repeating.xsl

In FileMaker this will be 2 records, 1 field (element).

Field element of record 1 = "some data

repeating.zip

This topic is 7378 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.