function - XSLT v1.0 - document() call external template -
i trying access xsl template in different xsl file inside template. 2 templates on different xsl files , that's reason need document function. templates apply on different xml files.
my problem how call second template inside first one. sample of code:
i inside template library:
<xsl:template match="library"> <fo:table table-layout="fixed" width="160mm"> <fo:table-column column-width="80mm"/> <fo:table-column column-width="80mm"/> <fo:table-body> <fo:table-row> <xsl:for-each select="document(library/@file)/document/books"> <xsl:apply-templates select="."/> </xsl:for-each> </fo:table-row> <fo:table-body> </fo:table> </xsl:template>
and trying access template books:
<xsl:template match="books"> <fo:table-cell> <fo:block font-family="arial" font-size="8pt" text-align="left"> <xsl:value-of select="substring(@iban,4)"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block font-family="arial" font-size="8pt" text-align="left"> <xsl:value-of select="@date"/> </fo:block> </fo:table-cell> </xsl:template>
the first argument inside document function not seem set correctly. thoughts on how should rewrite ? couldn't find issue in forum having similar problem. appreciated, thanks
to bring template in xslt file, use xsl:import
or xsl:include
. use xsl:document
when want apply xslt templates xml found in specified document in addition default input xml.
unfortunately, not able use variable in path xslt file because path resolved @ compile-time.
if path cannot determined statically (possibly achieving needed variation via relative path specification), might want reconsider overall organization. go far compose xslt programatically before running able dynamically write static @href, reconsider overall solution architecture before going far.
Comments
Post a Comment