[xquery-talk] when to use document { }?

Howard Katz howardk at fatdog.com
Mon Jul 25 18:33:52 PDT 2005

I just came across an example of a query being used to generate an xhtml
document where the query is wrapped in a document constructor  :

document {
<html xmlns="http://www.w3.org/1999/xhtml">



What is the document constructor doing in this case? The query would
generate perfectly good xhtml without it, would it not? I know that Saxon
automatically applies document construction to any document being serialized
(unless you turn it off), but I've seen lots of perfectly valid xml/xhtml
generated without its use in other environments. What's the difference
between the two cases?


More information about the talk mailing list