How to specify the indent parameter and others

By default xquery set indent parameter as no. How to overwrite this in a xquery?

If I want to put "<?xml version="1.0" endoing="UTF-8"?> in the xquery output , where and how to put it? It looks like no matter where I put it, it always gives me compilation error.

Thanks,

Hi,

you cannot add


<?xml version="1.0" endoing="UTF-8"?>

directly to the text of an XQuery, but you can force XQuery to return
this by specifying

 
{?serialization method="xml"?}

as the first line of your XQuery. Please note that the result of the XQuery expression must be well-formed XML then!

What do you mean by indent parameter? Indentation is not a concept of XML. You can only indent a repesentation of XML, e.g. by using a style sheet (see e.g. section SerializationSpec of the Tamino documentation)

regards

harald

Does “the first line of your XQuery” mean before everything including the prolog? I tried different postion and it doesn’t seemed to work.

What I meant “indent parameter” is the serialization parameter listed in C.3 from “XQuery 1.0: An XML Query Language” on w3c website.

In XSLT, I can have:
<xsl:output method=“xml” version=“1.0” encoding=“UTF-8” indent=“yes”/>

basicly what I want to do is to translate this into xquery. How would I do it?

Thanks.

Does “the first line of your XQuery” mean before everything including the prolog?

Yes