Try adding !indent=yes to the command line.


Michael Kay

From: Matthew Croxon []
Sent: 07 January 2010 09:44
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):

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

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

My xpath expression is therefore:

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).