Sorry, re-sending with correct subject.
-----Original Message-----
From: Michele R Combs mrrothen(_at_)syr(_dot_)edu
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Monday, January 7, 2019 9:03 AM
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] Re: XSLT access to fields in FMPXMLRESULT
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(_dot_)bauman(_at_)northeastern(_dot_)edu>
Sent: Friday, January 4, 2019 3:32 PM
To: Michele R Combs <mrrothen(_at_)syr(_dot_)edu>
Cc: Wendell Piez <wapiez(_at_)wendellpiez(_dot_)com>
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:
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--