This is the mail archive of the kawa@sources.redhat.com 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]

xquery document() alternatives?


<Marc Martinez
<does anybody have suggestions on how to get around the xquery document()
<function's requirement for a url-accessible source?
....

Not sure this is what you need. I used this in a java module loadable into
xquery to implement a function that queries a xml database and returns a
document (like a wrapper over document())

//result is a java.lang.String that represents an XML - the result of a search on our xml //database

SourceMessages messages = new SourceMessages();
TreeList doc = new TreeList();
XMLParser parser
= new XMLParser(new LineBufferedReader( new java.io.StringReader(result)),
(Consumer) new NamespaceResolver(doc),messages);
doc.beginDocument();
parser.parse();
if (messages.seenErrors())
throw new SyntaxException(messages);
doc.endDocument();

Then u can use doc as a document.

Hope I got the right meaning from your question .

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


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