This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XPath over DOM
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] XPath over DOM
- From: Uche Ogbuji <uche dot ogbuji at fourthought dot com>
- Date: Thu, 15 Feb 2001 22:19:42 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
> > > Are there any Java-based XSLT or XPath implementations (at
> > least partial
> > > functionality) that can traverse over existent DOM object,
> > as opposed to
> > > creating their own in-memory structure? I need to be able
> > to provide my own
> > > Document object built by my own parser, not just DOM APIs
> > over internal
> > > processor structure (as Saxon implementation).
> >
> I think Xalan and Oracle can both do this.
>
> > Why would any Java XSLT processor have a problem working with
> > another's DOM nodes?
>
> Saxon doesn't do it (at present) because of the cost and complexity of (a)
> sorting nodes into document order when they don't contain a serial number,
I see the cost, but this should not exced cost of conversion. In abstract
terms, it's a single tree traversal, with one assignment per node. Is there
really any property of Java that would make this more expansive than a tree
traversal with complete object instantiation and initialization per node?
> (b) skipping over and counting nodes correctly in the presence of things
> such as entity reference nodes, CDATA nodes, and unnormalized text nodes,
> and
There is a normalize() if the user doesn't mind mutation. The rest, at least
as I've attacked it, is a matter of wrapping, again in the same pass as
doc-order indexing.
> (c) dealing with the multitude of ways that the DOM allows namespace
> nodes to be (or not be) represented.
??? Do you mean Level 1 vs. Level 2?
--
Uche Ogbuji Principal Consultant
uche.ogbuji@fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list