1

When I try to run this XSLT style sheet (adapted from http://www.oxygenxml.com/archives/xsl-list/201001/msg00361.html) with Saxon 9.1.0.8 or Saxon-HE 9.5.1.3J, I get an empty output file.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/" version="2.0">
  <xsl:output saxon:recognize-binary="yes" method="text"/>
  <xsl:template match="/">
    <?hex 07?>
    <xsl:processing-instruction name="hex" select="'07'"/>
  </xsl:template>
</xsl:stylesheet>

From the Saxon documentation and the message mentioned above, I would have expected that the output is a string containing one (or two) ^G characters. Why did I not get any output at all?

1
  • Please elaborate on your question. Currently it is unclear what you are asking
    – hek2mgl
    Jan 22, 2014 at 16:45

2 Answers 2

1

Custom serialization requires Saxon-PE (or EE).

You should've gotten an error similar to this:

Transformation failed: Requested feature (custom serialization {http://saxon.sf.net/}recognize-binary) requires Saxon-PE

http://saxonica.com/documentation/index.html#!extensions

3
  • More specifically, with 9.3.0.5 I get "Error at xsl:output on line 3 column 59 of test.xsl: XTSE0020: Serialization parameter {{saxon.sf.net}recogniz...} is not available in Saxon-HE Failed to compile stylesheet. 1 error detected." Jan 22, 2014 at 18:55
  • For some reason I am not getting the error message. I expected the attribute to be available, because on other attributes (e.g. for saxon:ptree), the documentation explicitly states that Saxon-EE and/or Saxon-PE is required. Not so for saxon:recognize-binary - perhaps that is an oversight. Jan 23, 2014 at 7:37
  • @user1010997 - I think any attributes or extension functions in the saxon namespace require PE/EE. I don't have anything to confirm that though. Jan 23, 2014 at 15:53
1

I tried it with Saxon-EE 9.3.0.5 and it works.

Note that you need the xsl:processing-instruction form. Literal PIs in a stylesheet are stripped out, they do not cause processing instructions to be sent to the output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.