From: Wolfgang M. <wol...@ex...> - 2005-03-07 10:11:43
|
> Help! I created a simple xquery (which works fine in the "Basic xquery > interface"). I then saved the query in a file named current.xq and placed > it in eXists' xquery directory. When I call the query using the uri > http://localhost:8080/exist/xquery/current.xq , the query runs perfectly, > but the result is missing the <?xml version...?> declaration and has an > added html <!DOCTYPE...> tag. What am I doing wrong? I need the xml > declaration and not for my client app to work properly. The <!DOCTYPE> declaration is added by Cocoon, not eXist. If you don't want Cocoon to post-process the result, change the file name to end with .xql instead of .xq. The xquery will then be processed by the xquery servlet, not Cocoon. Also, you can use a pragma to set the desired output options. In your query add: (::pragma exist:serialize omit-xml-declaration=no ::) > The other thing I tried was using a transform:transform($root, > "stylesheet.xsl", $params) where the stylesheet's output mode was set > explicitly to "xml" but I recieved the same results. Same thing here: the output is passed to Cocoon. Wolfgang |