[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

repeating/portal fields in filemaker FMPXMLRESULT?

Subject: repeating/portal fields in filemaker FMPXMLRESULT?
From: Eric Scheid <eric.scheid@xxxxxxxxxxxxxxx>
Date: Fri, 09 Dec 2005 18:10:05 +1100
fmpxmlresult
Hi, I'm looking for a general solution to a problem I anticipate facing many
times over. I've checked the archives with no success, but maybe I don't
know the magic keywords for this problem.

The problem is this - consider this XML fragment:

<resultset>
    <row>
        <col><data>fred</data></col>
        <col> <!-- zero or more children -->
            <data>2005-06</data>
            <data>2005-07</data>
            <data>2005-08</data>
        <col>
        <col> <!-- same number of children as col[2] -->
            <data>open</data>
            <data>draft</data>
            <data>closed</data>
        <col>
    </row>
    <row>
        <col><data>wilma</data></col>
        <col>
            <data>2005-06</data>
            <data>2006-01</data>
        <col>
        <col>
            <data>open</data>
            <data>closed</data>
        <col>
    </row>
</resultset>

The first <col/> always only has one <data/> child. The second and third
<col/> may have zero to many <data/> children, but will always have the same
count (ie. if col#2 has 3 children, col#3 will have 3 children).

The problem I'm facing is that I want to transform this to look more like
this:

<whatever>
    <record>
        <name>fred</name>
        <!-- zero or more entry children -->
        <entry><!-- with exactly the same child elems -->
            <month>2005-06</month>
            <status>open</status>
        </entry>
        <entry>
            <month>2005-07</month>
            <status>draft</status>
        </entry>
        <entry>
            <month>2005-08</month>
            <status>closed</status>
        </entry>
    </record>
    <record>
        <name>wilma</name>
        <entry>
            <month>2005-06</month>
            <status>open</status>
        </entry>
        <entry>
            <month>2006-01</month>
            <status>closed</status>
        </entry>
    </record>
<whatever>


The approach I've considered has been to use <xsl:for-each select="row"> to
cycle over each row, and then <xsl:for-each select="col[2]/data"> to cycle
over each <data/> in the second column ... but how do I then reference the
corresponding nth child of col[3]? Should I not use nested xsl:for-each to
tackle this problem, but instead some other method?

e.

ps. keywords for the archive, if I ever need to come searching again
    FMPXMLRESULT, Filemaker, repeating fields, portal fields, </data><data>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.