Using the .NET version of Saxon 9.4, I run a command line like:
Query.exe -s:myfile.xml -qs:/cruisecontrol/build/msbuild[@success='true']/project[1]/target[@name='GetLatestSource']/message[last()]/text()
and I get a result like
<?xml version="1.0" encoding="UTF-8"?>375
How can I turn off the XML header (omit the XML declaration) so that I just get 375
as output? I've checked the documentation, but perhaps I'm just missing it.
Figured it out...
I needed to add the omit-xml-declaration
option:
Query.exe -s:myfile.xml -qs:"declare option saxon:output 'omit-xml-declaration=yes'; /cruisecontrol/build/msbuild[@success='true']/project[1]/target[@name='GetLatestSource']/message[last()]/text()"
would be one way to accomplish this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With