[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsltproc -maxdepth
Heinrich Nbongo heinrich_nbongo@xxxxxxxxxxx wrote:
I admit, haven't dealt with xslt for a long time. However, I bumped into this option "xsltproc -maxdepth", and couldn't find a sufficient information of what exactly it controls ("max. template stack depth" - which doesn't mean nothing to me). Could any provide me with more info of which problem is solves (ok, max nr of recursion, but recursion of what exactly?) , and how exactly it has been solved. 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
|
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
|