Stop Saxon from returning XML declaration encoding attribute

Viewed 107

I am running Saxon from the command line

java -cp Saxon net.sf.saxon.Query some.xquery

It runs and returns string data.

However, it als includes the following:

<?xml version=“1.0” encoding=“utf-8”?>

What option or parameter is required in xquery or java call to prevent this from being part of the output?

1 Answers

If it's returning string data then you probably don't want & and < to be escaped, so you should be running with method=text. You can specify that either within the query itself (declare option output:method "text"); , or on the command line (!method=text).

Related