xsl-list
[Top] [All Lists]

[xsl] Re parsing element data generated by XSLT within the same stylesheet

2009-12-29 13:32:29
I'm trying to learn XSLT (better). I'm working with an existing complicated stylesheet that I need to make changes to. I have a working solution where I output the XSLT piped to XQuery (which I know better) but I'd like to do the whole thing in XSLT.

The basic concept/solution I'm looking for is: is it possible, and how, to re-process generated elements that are not in the source document.

Simplified example: suppose I have a template like this. Suppose I have LOTS of templates like these.

<xsl:template match="v3:renderMultiMedia/v3:caption">
       <p>
           <xsl:call-template name="styleCodeAttr">
               <xsl:with-param name="styleCode" select="@styleCode"/>
               <xsl:with-param name="additionalStyleCode"
               select="'MultiMediaCaption'"/>
           </xsl:call-template>
<xsl:apply-templates select="@*[not(local-name(.)='styleCode')]"/>
           <xsl:apply-templates mode="mixed" select="node()"/>

       </p>

</xsl:template>



What I'd like to do is change every <p>XXX</p> into XXX&#10;

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".

Right now, as I mentioned, I'm doing this by piping the output into
XQuery where its a trivial thing to change the <p>,
in fact a 2nd pass of XSLT could just as trivially do it. But can it be
done within one invocation ?

Any clues on where to look (I have Mr. Kay's excellent book) appreciated.

Thank you.

--
David A. Lee
dlee(_at_)calldei(_dot_)com http://www.calldei.com
http://www.xmlsh.org
812-482-5224


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>