0
votes

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:template 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?

2
Good installation Pacerier ;-)!Emiliano Poggi
Post a minimal example of the XML and the XSLT and we might be able to help. It is likely that your template matches and/or XPaths are not matching the XML structure, but there could be any number of reasons (case sensitivity, type-o, namespace mis-match, etc).Mads Hansen
1.xml and 2.xsl -- what do they contain? It is not just serious to say: "My program X when given the input Y produces no output" and not to show either X or Y -- regardles of the programming language your program is written in.Dimitre Novatchev

2 Answers

2
votes

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.

1
votes

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.