Converting DOM to Qexo Infoset?

Daniel Aborg lists.kawa@daborg.fastmail.fm
Mon Apr 30 06:32:00 GMT 2007


Per Bothner wrote:
>> 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?
That would be great.

> 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.)
There's no standard way that I'm aware of but we have libraries that do 
it for you and it would be pretty easy to implement anyway. I'd be happy 
to deal with that if I knew how to turn a SAX stream into KNodes. :-)


Thanks for your help,

Daniel



More information about the Kawa mailing list