Why Saxon does not produce any file output?
XSLT parsers should produce an empty file even if there is no explicit text output. However, I have a situation where Saxon-HE 9.3 does not produce any file output at all.
I compiled the files using this command:
Transform -s:1.xml -xsl:2.xsl -o:3.html
Whereby the contents of 1.xml is:
<?xml version="1.0"?>
<!-- greeting.xml -->
<x>
<greeting>1</greeting><greeting>2</greeting>
</x>
And the contents of 2.xsl is:
<?xml version="1.0"?>
<!-- greeting3.xsl -->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:templa开发者_如何转开发te match="/"/>
</xsl:stylesheet>
However, there is no output (not even an empty file). Neither is there any error message.
What could have been the problem?
It's perfectly possible for a transformation to be 100% correct and yet produce no output. Here's an example stylesheet that does just that:
<xsl:template match="/"/>
So the conjecture is that there's a bug in your code, and if you want us to help you find it, you'll need to show us your code.
It's likely to be a bug or an "insufficient privileges" problem.
When the files 1.xml, 2.xsl, and Transform.exe are located in the desktop, there are no problems with the output.
But when the files are in C:\
, it gives an error message:
Failed to create output file file:/c://3.html: Access to the path 'c:\3.html' is denied.
Yet for some reason, when the files are in C:\Program Files\Saxonica\SaxonHE9.3N\bin
, there's no output and no error message.
精彩评论