Document Result from Xquery using s9api ?
Added by Anonymous about 16 years ago
Legacy ID: #5542538 Legacy Poster: julian hall (julian_hall)
Hi I'm doing an XQuery command using the s9api and I'm trying to get the result as a document. Eg. ... XdmDestination dest = new XdmDestination(); XQueryExecutable exp = _xqueryCompiler.compile("document {.}"); XQueryEvaluator eval = exp.load(); eval.setContextItem(item); eval.run(dest); _doc = dest.getXdmNode(); // ** not a document ** the document that is returned is a TinyElementImpl and I am trying to get a TinyDocumentImpl returned... does anyone know how to do this? or if it is even possible? I know i could serilize it to a string and reparse it ... but that just doesn't seem very efficient ;) any help thanks. Jules
Replies (3)
Please register to reply
RE: Document Result from Xquery using s9api ? - Added by Anonymous about 16 years ago
Legacy ID: #5543050 Legacy Poster: Michael Kay (mhkay)
I'm not sure at the moment why this gives you an element - will investigate. But I would do this using _doc = eval.evaluate() which returns a document node as expected. No need to create an XdmDestination here. Michael Kay http://www.saxonica.com/
RE: Document Result from Xquery using s9api ? - Added by Anonymous about 16 years ago
Legacy ID: #5549645 Legacy Poster: Michael Kay (mhkay)
This bug is now documented at https://sourceforge.net/tracker2/?func=detail&aid=2212387&group_id=29872&atid=397617 and a fix (to module ComplexContentOutputter) is in Subversion. I've tested the fix more carefully than usual because it is on a fairly sensitive path. It seems to be OK, but it wouldn't greatly surprise me if there are unintended side-effects - hopefully only affecting rather rare use cases.
RE: Document Result from Xquery using s9api ? - Added by Anonymous about 16 years ago
Legacy ID: #5549873 Legacy Poster: julian hall (julian_hall)
Thank you! Appreciate the quick response and fix! Working as expected.
Please register to reply