This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Converting DOM to Qexo Infoset?


Daniel Aborg wrote:
Hi,

I'm exploring using Qexo as an alternative to Saxon and I've run into a bit of a snag.

We have an xquery script that takes DOM trees as external variables. However, when I try to run this script in Qexo it tells me that it expects a Qexo NodeType rather than a DOM Node. Based on this I'm assuming that Qexo does not support natively accessing DOM trees and that I must convert my DOM tree to a Qexo Infoset.

Basically Qexo has its own DOM implementation. If you compile Kawa with JAVA5 features selected, then gnu.kawa.xml.KNode and its subclasses will implement the standard DOM Node interfaces. However, this is not the default because of binary incompatibile changes in the Node interface between JDK 1.4 and 1.5. Sigh.

Unfortunately, I can't find any indication of how to do this in any of the documentation, in the APIs, or in the sources themselves.

How would I go about converting a DOM tree to what Qexo expects so I can pass it to the xquery script as an external variable?

I agree there should be a away to convert a org.w3c.dom.Node to a gnu.kawa.xml.KNode object. It shouldn't be that difficult.

It would be somewhat easier to convert SAX event sequence to a Node,
since there is ready code for this: I just need to write an appropriate
10-line glue method.  Will that work for you?

Is there some standard way to "serialize" a DOM to a SAX stream?
(It's obviously easy to do, but I don't want to needlessly
re-invent the wheel.)
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]