|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: numbering and document()
Wendell Piez wrote:
Felix, As it happens I just had to do this for a current project. I find it works well to do a "transclusion" pass, saving the result in a variable and then just do "apply templates" on that variable. Here's the basic technique I use: <xsl:template match="/">
<xsl:choose>
<xsl:when test="//include"><!-- Any inclusions in top-level doc? -->
<xsl:variable name="transcluded-doc">
<xsl:call-template name="do-transclusion"/>
</xsl:variable>
<xsl:apply-templates select="$transcluded-doc" mode="normal"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="/" mode="normal"/>
</xsl:otherwise>
</xsl:when>
</xsl:template><xsl:template match="/" mode="normal"> <xsl:apply-templates/> </xsl:template> The "do-transclusion" template is just an identity transform plus handling for the inclusions. If you want to be really sophisticated you can do id and reference rewriting (for example, to implement XInclude in a way that allows component documents to have the same ID values). Cheers, Eliot -- W. Eliot Kimber, eliot@xxxxxxxxxx Consultant, ISOGEN International 1016 La Posada Dr., Suite 240 Austin, TX 78752 Phone: 512.656.4139 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








