이 입력 :
<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 함께 프레 젠 테이션/인코딩 문제가 있다면 코드 서식 버튼을 사용하여 문자를 탈출하시기 바랍니다. –