Project

Profile

Help

XQJ with object input source

Added by Anonymous almost 14 years ago

Legacy ID: #9081625 Legacy Poster: Jeffrey Hair (projectmoon)

Perhaps I'm missing something really obvious, or just don't completely understand XQJ. I've looked over the documentation, and nothing immediately jumps out at me for solving my problem. I have an object, say a org.w3c.dom.Node, or an InputStream, or a SAX Source. I can get it into pretty much any form needed, really. Is there a way to use Saxon HE's XQJ processor with that object? I understand the basics of XQJ: Create data source, create connection from data source, and then create and execute expressions. But I don't see any way to actually feed it input XML short of declaring a path to a document in the XQuery itself.


Replies (2)

RE: XQJ with object input source - Added by Anonymous almost 14 years ago

Legacy ID: #9083048 Legacy Poster: Michael Kay (mhkay)

You need to use one of the methods such as bindDocument() in the XQDynamicContext interface. The class XQExpression implements this interface, so you can call bindDocument() before calling executeQuery(). I'm no fan of XQJ, by the way. I designed s9api out of frustration with its weaknesses. Part of it is terminology - XQDataSource is not a data source, XQConnection is not a connection, XQExpression is not only an expression but also its dynamic context, XQSequence is not only a sequence but also a cursor/iterator.

RE: XQJ with object input source - Added by Anonymous almost 14 years ago

Legacy ID: #9085837 Legacy Poster: Jeffrey Hair (projectmoon)

Thanks. Guess it was something obvious that I missed.

    (1-2/2)

    Please register to reply