You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Donald Ball <ba...@webslingerZ.com> on 2000/07/27 09:05:51 UTC

still having trouble writing extension function in java

i'm still trying to figure out how to resolve a tree of xsl elements from
an extension function. suppose i've got this:

<tf:paragraphize>
 <xsl:value-of select="content"/>
</tf:paragraphize>

what i end up seeing in my extension function is an element that's an
instance of org.apache.xalan.xslt.ElemValueOf. I note that the good stuff
goes on in the execute method - looks like I should call it like so:

execute(context.processor,
        context.sourceTree,
        context.sourceNode,
        some mode)

unfortunately, it doesn't seem that i can specify the destination of the
execution - it will necessarily go to processor.m_resultTreeHandler. i
guess i could patch xalan to provide an alternate execute method that
returned a String or a Node, or took a ContentHandler as an extra
argument. either that or i could allow the tf:paragraphize element to
select its data from the source tree directly, but it seems more flexible
to allow the author to access the source tree through familiar xsl
elements.

does anyone else have an xalan extension functions i could compare coding
styles against? i've gleaned all that i'm going to be able to glean from
Redirect and RowSetLocator (although an example of a stylesheet that calls
RowSetLocator would be illuminating).

- donald