[xsl] Re: XSLT access to fields in FMPXMLRESULT

Subject: [xsl] Re: XSLT access to fields in FMPXMLRESULT
From: "Michele R Combs mrrothen@xxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Jan 2019 14:02:44 -0000
Thanks, Syd, the "getValue" template looks very useful.  Am I right in
thinking that I would need to call this template all three places -- i.e.,
where I'm setting up the keys, where I do the grouping for output, and where I
sort the output for each letter?  Because the leading quote needs to be
ignored in all three places.

Also, just FYI, I was wrong about the XSLT processor.  We use Saxon for our
standalone transforms but this one happens as part of a FileMaker export (FMP
offers the option of applying a style sheet as part of the XML export
process).  According to the documentation, "...The XML import and export
features in FileMaker Pro use an XML parser called Xerces and an XSLT style
sheet processor called Xalan."  From what I can glean from the FileMaker
community, it's rather old tech and doesn't support 2.0 let alone 3.0

Michele

-----Original Message-----
From: Syd Bauman <s.bauman@xxxxxxxxxxxxxxxx>
Sent: Friday, January 4, 2019 3:32 PM
To: Michele R Combs <mrrothen@xxxxxxx>
Cc: Wendell Piez <wapiez@xxxxxxxxxxxxxxx>
Subject: XSLT access to fields in FMPXMLRESULT

I agree completely w/ Wendell -- I generally only use XSLT 1 if my target
processor is a web browser. (Which is pretty rare these days; and *could* be
done in XSLT 3 using XML Jelly Sandwich.)

But more importantly, you might find it nicer to arrange your XSLT program so
that it accesses the FMP data by field name, rather than column number.

The XSLT 1.0 routine at the end of this mail does just that. (Wendell helped
me write it in ~2006. :-)

A template that uses it might start something like this:

+---------
|   <xsl:template match="f:ROW">
|     <!-- ==================================================== -->
|     <!-- obtain the values we'll need later from the FMP data -->
|     <!-- ==================================================== -->
|     <xsl:variable name="TranscriptionID">
|       <xsl:call-template name="getValue">
|         <xsl:with-param name="fromField">TranscriptionID</xsl:with-param>
|       </xsl:call-template>
|     </xsl:variable>
|     <xsl:variable name="Filename">
|       <xsl:call-template name="getValue">
|         <xsl:with-param name="fromField">Filename</xsl:with-param>
|       </xsl:call-template>
|     </xsl:variable>
|     <xsl:variable name="OTID">
|       <xsl:call-template name="getValue">
|         <xsl:with-param name="fromField">OT_ID</xsl:with-param>
|       </xsl:call-template>
|     </xsl:variable>
|     <xsl:variable name="RefnameCopy">
|       <xsl:call-template name="getValue">
|         <xsl:with-param name="fromField">OT
Information::RefnameCopy</xsl:with-param>
|       </xsl:call-template>
|     </xsl:variable>
|     ...
+---------

Anyway, here's an attached copy of the program that does the work:

[demime 1.01d removed an attachment of type application/ms-tnef which had a name of winmail.dat]

Current Thread