xalan extensions - get the result tree

Jan Hoeft <[email protected]>
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.