Try adding !indent=yes to the command line.
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



From: Matthew Croxon [mailto:mattcrox@gmail.com]
Sent: 07 January 2010 09:44
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Saxon XQuery ResultFormat

Hi there,

I know this seems like quite a silly question, but it has had me stuck on it for the last couple hours.

The problem is that I am recieving XQuery results in a string format (returned as a single line), as opposed to the XML returned with carriage returns.

Here are the details:

I am running a simple XQuery using the following source XML (catalog.xml):

<catalog>
<product dept="WMN">
<number>557</number>
<name language="en">Fleece Pullover</name>
<colorChoices>navy black</colorChoices>
</product>
</catalog>

and I would like to list all of the product elements.

My xpath expression is therefore:
doc("catalog.xml")/catalog/product

I am using the following command line to run the Saxon Query class:
java -classpath "c:\libs\saxon9he.jar" net.sf.saxon.Query -q:"c:\test.xq"

Here is my result (as a single line).

<?xml version="1.0" encoding="UTF-8"?><catalog><product dept="WMN">
<number>557</number><name language="en">Fleece Pullover</name><colorChoices>navy black</colorChoices></product></catalog>

Any help would be much appreciated - it is probably some switch that needs to be enabled/disabled (I have tried all of them).

Thanks,

Matt