saxon - outputting text in XQuery using saxon9he: how do I get "<" and ">" created in the output themselves, not escaped? -
my xquery script:
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; declare option output:method "text"; $row in all/row return ('"<row>","',data($row),'"
')
my xml:
<all> <row>one</row> <row>two</row> <row>three</row> </all>
my command line:
java -cp …/saxon9he.jar net.sf.saxon.query '!omit-xml-declaration=yes' -s:./trouble-with-output-escaping.xml -q:./trouble-with-output-escaping.xqy
my output created saxon9he:
"<row>"," 1 " "<row>"," 2 " "<row>"," 3 "
i want have output this:
"<row>","one" "<row>","two" "<row>","three"
during web investigation came across xslt's disable-output-escaping. thought: if xquery had that, might help.
update/0:
actually nothing (visible) wrong above xquery script. namespace declaration above needs replaced one:
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
looks same, isn't, michael pointed out.
having completed this, above example of how create text output using xquery.
in other place michael showed, how rid of space (0x20), being used separate lines, i.e. space character preceding lines 2 end:
string-join(…,"")
where "…" entire flwor.
it's doing right thing if set output method "text" command line, is
java net.sf.saxon.query -q:test.xquery -s:test.xml -t !method=text
but had me baffled why setting serialization options within query isn't working. looking @ in debugger, though, see uri, looks like
http://www.w3.org/2010/xslt-xquery-serialization
actually contains several occurrences of decimal 8203, hex 200b, zero-width space. means uri doesn't match serialization output uri, , "declare option" unrecognized uri ignored.
Comments
Post a Comment