9 Replies Latest reply on Nov 8, 2016 12:29 PM by beverly

    XSLT Import with WITH-PARAM

    Malcolm

      I want to confirm that I'm bumping into a problem with the FMP xml engine and not making a stupid mistake. I'm trying to pass the Layout ID into the Field template. I have the following (simplified) code which produces the result that I want when I run it in xsltproc. When I use the same methods to import data the Layout ID field is empty.

       

      If it isn't possible to use with-param to pass the layout, what method can be used to obtain the layout ID? The XML is from the DDR and the Field element could be nested at any level.

      <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.filemaker.com/fmpxmlresult">     <xsl:template match="/">             <xsl:apply-templates select="/FMPReport/File/LayoutCatalog"/>     </xsl:template>     <xsl:template  match="Layout">         <xsl:apply-templates>             <xsl:with-param name="lytID" select="@id" />         </xsl:apply-templates>     </xsl:template>           <xsl:template  match="Field">         <xsl:param name="lytID" />         Layout id: <xsl:value-of select="$lytID"/>         Field id: <xsl:value-of select="@id"/>     </xsl:template> </xsl:stylesheet>