当我尝试使用Saxon 9.1.0.8或Saxon-HE 9.5.1.3J运行此XSLT样式表(改编自http://www.oxygenxml.com/archives/xsl-list/201001/msg00361.html)时,我得到一个空的输出文件。
<?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>
从Saxon documentation和上面提到的消息,我原以为输出是一个包含一个(或两个)^G
个字符的字符串。为什么我根本没有得到任何输出?
答案 0 :(得分:1)
答案 1 :(得分:1)
我尝试使用Saxon-EE 9.3.0.5并且它可以工作。
请注意,您需要xsl:processing-instruction表单。样本表中的文字PI被删除,它们不会导致处理指令被发送到输出。