You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Simon Kitching <si...@ecnetwork.co.nz> on 2002/10/08 04:44:39 UTC
extensions: creating nodes for return from custom extension elements
Hi All,
I need to write an extension element which returns a node with various
children, attributes, etc.
Does anyone know how I create nodes in my extension code? None of the
examples or standard Xalan extensions appear to do this, ie I can't find
any code to steal.
Normally, nodes are created via factory methods on the Document object
to which they are later going to be attached. However I can't see any
way to get at the Document object associated with the Result object to
which the results of the transformation are being written.
Looking at the XSLProcessorContext.outputToResultTree method, it looks
like the nodes that are returned from the extension are actually
expected to reside in the source document (ie are cloned when output to
the result), but I can't see any way to create new nodes in the source
document either.
The ElemExtensionCall object passed to the extension method inherits
from UnImplNode, which has a Node interface, but whose methods (like
getOwnerDocument) are not very useful :-).
I'm probably missing something very obvious....
Thanks,
Simon
Re: XPath 2.0
Posted by Joseph Kesselman <ke...@us.ibm.com>.
There is an experimental and still-incomplete version of XPath/XSLT 2.0
checked into CVS on Xalan's XPATH20 branch. I wouldn't really recommend
trying to use it yet unless you want to get involved in the development
process.
When it's ready for more general use, we'll make an announcement.
______________________________________
Joe Kesselman / IBM Research
XPath 2.0
Posted by Richard Emberson <re...@outerharbor.com>.
Is there an implementation of XQuery1/XPath2 available?
What is the xalan ETA for XPath2 ?
Thanks
Richard
Re: extensions: creating nodes for return from custom extension elements
Posted by Joseph Kesselman <ke...@us.ibm.com>.
Create the nodes using your favorite DOM implementation and pass those
back. Xalan should recognize that they implement org.w3c.dom.Node and do
the right things with them. They don't have to be in the same document;
we're going to extract the data from them and rebuild it into the output
document anyway.
There's an outstanding enhancement suggestion that it might be nice to be
able to do something similar with SAX, but we haven't had time to look at
it.
______________________________________
Joe Kesselman / IBM Research