Subject: Re: [xsl] output the result of the transformation twice, indented and not indented, without duplicating the code|
From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 May 2022 21:13:39 -0000
Indeed it is ... but what if already you had written a template for the root node? Using <xsl:apply-templates/> as you have above would push the children of the root node and your previously-written template for the root node never would be triggered.
I understand now. Indeed, I already had a template for the root node. I solved this issue by putting that code into a template for the root element (rather than root node).
Graydon's approach saves the time for executing the transformation twice, but with the penalty of internal storage, so youB would have to factor that in to weighing your alternatives.
Thanks a lot for the explanation!