Export to XML, non flat, using xslt -
07-24-2011
, 02:35 AM
Can someone point me to a tutorial how to phrase an XSLT file that
translates my FMPXMLRESULT export into a non-flat XML file? The desired
XML file (ISO 200200) contains
- one element "A"
- which contains one or more elements "B"
- which contain one or more elements "C"
In the Filemaker solution, B is a child of A and C is a child of B.
Following a hint in "Filemaker 10 in Depth", I found Jesse Feiler's
introduction on
<http://www.northcountryconsulting.com/content/filemaker-and-xml>
Feiler's example turns a flat Filemaker table into a flat table in xml
format. He uses
<xsl:for-each select="fmp:RESULTSET/fmp:ROW">
to loop through the records
and
<xsl:for-each select="fmp:COL">
<xsl:choose>
<xsl:when test="position()='1'">
to loop through the fields (where "position" refers to Filemaker's the
export field order.
Since I can export from one table only, my guess is a export C records
and add the B and A data with calc fields. Now how do I tell the XSLT
file to open and close A and B elements in the proper place?
After sorting the records in FMP, I could get the record's position in
the found set and the previous records data to tell whether a record is
the first one of a new B element, and what's that B element's data.
Can I use xsl commands to search for field data? Or, more general, are
there more xsl tutorials like Feiler's out there, i.e. something I can
understand although I'm not into web publishing?
--
http://clk.ch |