Hi

I want to query a custom tree (non DOM) with XPath
expression. Since Xalan expects the tree to be DOM,
I'm thinking of getting this done by overiding Xalan
DOM implementation (so that internally it uses my
custom API to access the tree). Which are the classes
I need to reimplement in this case? How easy would
this be?

I'm attaching another posting that appeared in this
list. Can someone throw more light on this?

-----------------------


Keep David Bertoni's comments about the future changes
possible
to Xalan and its DOM base classes... And you don't
mention if
your 'already built in-memory tree' is some
application specific custom
tree or of it's a DOM tree...

The classes you have to override depend on what you
want to do.
In my case, I just needed read-only access to some
application data
to use for some transformations.

I derived classes from:
XalanDocument
XalanElement
XalanAttribute
XalanText
XalanNamedNodeMap

The derived classes I made basically map requests for
data from thier
DOM interfaces to the data already supplied by my
application.
These five classes seem to be the minimum you can get
away with using
the current Xalan. (well, I suppose you don't need
Attribute or NamedNodeMap
if
you don't need to provide any attributes) There are no
namespaces in my
custom tree.

Also, you can get away with only implementing some of
the Node interface
methods fully.(And just return NULL or whatever is
appropriate for those you
don't implement)
Those methods are:
getNodeName
getNodeValue
getNodeType
getParentNode
getOwnerDocument
hasChildNodes
getLocalName
isIndexed
getIndex
(for Text nodes)
getData
getLength
----------

Regards,
Nirmal


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

Reply via email to