この入力:
<p> “ and ” </p>
このスタイルシート(単にアイデンティティルール)の場合:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
出力:
<p> “ and ” </p>
のみhtml
シリアライズ方法、出力でのXalan:あなたは正しいrenderizationをしたいのであれば
<p> “ and ” </p>
は、あなたが出力に適切なHTML文書を必要とする...
このスタイルシート:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<title>Test</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
出力:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>
</head>
<body>
<p> “ and ” </p>
</body>
</html>
注:適切なcharsetエンコーディング宣言。
入力文字に一致する出力文字はありますか?私は違いが見えません。これがStackoverflowでのプレゼンテーション/エンコーディングの問題である場合は、コードの書式設定ボタンを使用して文字をエスケープしてください。 –