In the past, TinyNodeImpl and its subclasses implemented the DOM Node
interface as well as the Saxon NodeInfo interface. This is no longer the
case, partly because the DOM interfaces were getting so absurdly big, and
partly because of the incompatibility between JDK 1.4 and JDK 1.5 versions
of these interfaces, meaning it wasn't possible to ship a product that
worked and compiled on both.
If you write an extension function that expects a DOM Node, then provided
you have saxon8-dom.jar on your classpath, Saxon should wrap the
TinyNodeImpl in a wrapper that implements the DOM interfaces for you.
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of
> Benjamin Jones
> Sent: 15 May 2005 17:52
> To: saxon-help@...
> Subject: [saxon] TinyElementImpl, Extension Functions, and
> Conversion of Saxon Objects to Node
> I am writing a series of Java Extensions to carry out some recursive
> transformations inside XQuery.
> These extensions are an adaptation of existing methods I have already
> written to operate on objects implementing org.w3c.dom.Node.
> When I apply the Java Extension to the XQuery object (inputN)
> I wish to
> transform, I can ascertain that the object is of type
> net.sf.saxon.tinytree.TinyElementImpl, and that its local
> name (given by
> inputN.getNamePool.getLocalName(inputN.getNameCode( )) called on the
> cast of object to NodeInfo) is correct. However, when I cast
> object to
> NodeInfo, I have all kinds of problems. I cannot, as I expected to be
> able, cast the object to Node, nor can I cast it to NodeWrapper.
> Also, inputN.getDocumentRoot() returns null.
> In a very helpful post that Michael Kay posted last year, said that
> TinyTree could be cast to Node (as implemented by a saxon
> implementation), except that some methods (such as update( ))
> available. A similar guidance as to how to get a Node from a
> TinyElement would be greatly appreciated.
> Ben Jones
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> saxon-help mailing list