How can I get the output as xml
?
nicholas@mordor:~/xml$
nicholas@mordor:~/xml$ java -jar /usr/share/java/saxon.jar -o outputfile.xml note.xml note.xsl
nicholas@mordor:~/xml$
nicholas@mordor:~/xml$ cat outputfile.xml
<?xml version="1.0" encoding="UTF-8"?>
Tove
Jani
Reminder
Don't forget me this weekend!
nicholas@mordor:~/xml$
nicholas@mordor:~/xml$ cat note.xml
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
nicholas@mordor:~/xml$
nicholas@mordor:~/xml$ cat note.xsl
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output media-type="text/html"/>
<xsl:mode on-no-match="shallow-copy" />
</xsl:stylesheet>
nicholas@mordor:~/xml$
Specifying an output file looks to be insufficient. Perhaps the xsl
file is incorrect for generating xml
?
-o outputfile.xml
instead of-o:outputfile.xml
. But I have no idea why you expect to use Saxon 6 with XSLT 3, you need at least Saxon 9.8 for XSLT 3 to be supported. – Martin Honnen Dec 3 '20 at 14:37-o outputfile.xml
as you said, thx. I'll try with xslt 2.x, it outputs the element content rather than actualxml
. – Nicholas Saunders Dec 3 '20 at 14:40<xsl:mode on-no-match="shallow-copy" />
to work with an XSLT 1 or 2 processor, Saxon 9.8 (at least for HE) is the first version to support XSLT 3 as specified by the W3C in 2017, for PE or EE you might get 3.0 support in earlier Saxon versions, but based on some intermediary working draft. – Martin Honnen Dec 3 '20 at 14:44