11 MB の xml ファイルに対して次のアイデンティティ変換を実行すると、5.5 MB のファイルになります。Saxon 9.4.0.6 を使用しています。出力要素にエンコーディング属性を追加すると、結果ファイルのサイズは 11 MB のままです。
エンコーディングあり:
<xsl:output method="xml" cdata-section-elements="Value" indent="no" encoding="utf-16"/>
エンコードなし:
<xsl:output method="xml" cdata-section-elements="Value" indent="no"/>
大きな違いはどこから来るのですか?ありがとうございました
XSLT:
<?xml version="1.0" encoding="utf-16"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" cdata-section-elements="Value" indent="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*" mode="#current"/>
</xsl:copy>
</xsl:template>