Re: Re parsing element data generated by XSLT within t
I'm trying to learn XSLT (better).
Keep in mind there are instructor-led XSLT/XQuery training classes coming up in Europe and California (I've mentioned them on my home page and will announce them in the new year):
I'm working with an existing complicated stylesheet that I need to make changes to.
Yes, by putting those elements into a variable and then acting on the variable contents.
Simplified example: suppose I have a template like this. Suppose I have LOTS of templates like these.
<xsl:variable name="intermediate" as="element(p)*"> <xsl:apply-templates/><!--this is what you are doing now--> </xsl:variable> <xsl:apply-templates select="$intermediate" mode="change-p-to-nl"/> ... <xsl:template mode="change-p-to-nl" match="p"> <xsl:copy-of select="node()"/> <xsl:text> </xsl:text> </xsl:template>
Of course you'll have to take away the as= constraint if in fact you don't always have <p> elements.
Obviously I can edit every template to change how it generates the output XML, but I'm wondering is there a way to do this in XSLT by saying "Re-parse the generated XML by this template".
By acting on the generated XML that was placed in a variable rather than in the result tree.
I hope this helps.
. . . . . . . . . . . . Ken
-- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
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