opensubscriber
   Find in this group all groups
 
Unknown more information…

x : xalan-j-users@xml.apache.org 18 June 2009 • 8:29PM -0400

xalan extensions - get the result tree
by Jan Hoeft

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi,
is it possible to get the result tree and work on it?

I am able to do the transformation on my own via executeChildTemplates.
But I have not found a way to process the result.

<xalan:component prefix="my" elements="countwords">
    <xalan:script lang="javascript">
        function countwords(context, elem){
            transf = context.getTransformer();
            transf.executeChildTemplates(elem,true);
            return "";
        }
    </xalan:script>
</xalan:component>

<xsl:template match="/">
    <my:countwords>
        <text>
            some words
            <xsl:value-of select="."/>
        </text>
    </my:countwords>
</xsl:template>

my xml file:

<root>
    some more words
</root>

What i am trying to do is to add an attribute count to the text output.

<text count="5">
     some words
     some more words
</text>

Any idea how to do this?
Cheers
Jan

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.