[Home] [By Thread] [By Date] [Recent Entries]
Heinrich Nbongo heinrich_nbongo@xxxxxxxxxxx wrote:
Think of apply-templates as a recursive method or function call. For instance with the input being <root>
<section>
<division>
<division>
<division>
<division>This is a test.</division>
</division>
</division>
</division>
</section>
</root>the stylesheet <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="root">
<html>
<xsl:apply-templates/>
</html>
</xsl:template><xsl:template match="section">
<body>
<xsl:apply-templates/>
</body>
</xsl:template><xsl:template match="division">
<div>
<xsl:apply-templates/>
</div>
</xsl:template></xsl:stylesheet> outputs <html>
<body>
<div>
<div>
<div>
<div>This is a test.</div>
</div>
</div>
</div>
</body>
</html>Now when I intentionally set --maxdepth 5 xsltproc aborts the transformation with an error message xsltApplyXSLTTemplate: A potential infinite template recursion was detected. You can adjust xsltMaxDepth (--maxdepth) in order to raise the maximum number of nested template calls and variables/par ams (currently set to 5). Templates: #0 name division #1 name division #2 name division #3 name section #4 name root
|

Cart



