確かにそれは可能です。ID変換を使用して、<break>
特別に処理するだけです。を使用してコピーする代わりに、<xsl:copy>
必要なテキストを出力します。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="break">
<xsl:value-of select="' '"/>
</xsl:template>
</xsl:stylesheet>
私は
あなたが使用できる文字通りの出力が欲しいですdisable-output-escaping
、のように
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="break">
<xsl:value-of select="'&#10;'" disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
ただし、これはオプションの機能であり、XSLTプロセッサでのサポートが保証されているわけではありません。