I noticed somewhat of a hole in XQuery ... hoping I am wrong.
I can find no way to set the base URI of a constructed document e.g

document {  <root/> }

such that fn:document-uri() would return it.

It seem this is one of those properties that must come from the outside 
environment.
I know if I were to store the document to a file then re-read it, likely the 
XML processor would pick it up ... I also know how to do this programmatically 
in API's like say Saxon.
But it seems missing from XQuery itself.   My guess is that since XQuery doesnt 
support storing documents it was thought unimportant to set the document URI.

Why I ask ?
I'm still looking at Streaming XDM formats, including pure in-memory streaming.
But it seems like I cannot directly encode and pass on a document (or base) URI 
through XQuery by itself to the output.   So any constructed documents would 
have none or undefined URI's to the receiver.   this leads me to think I need a 
meta encoding for XDM much like proposed at Balisage (XDML).   basically 
passing the URI information as seperate XDM values and a convention for 
interpreting them.  This seems like it could not be done in pure XQuery however 
because the target even if it got say  a sequence ( "uri" , document ) has no 
way to apply the uri to the document using XQuery so it must be done by 
external code.

Thanks for any commentary.
-David


----------------------------------------
David A. Lee
[email protected]<mailto:[email protected]>
http://www.xmlsh.org

_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to