我正在使用外部实体引用"ISOEntities";在我的XML文件中查找特殊字符,但它没有包含在文件中,并且XML由于编码的特殊字符而出现错误。
<?xml version="1.0" encoding="UTF-16"?>
<!DOCTYPE root[
<!ENTITY % ISOEntities PUBLIC "ISO 8879-1986//ENTITIES ISO Character Entities 20030531//EN//XML" "http://www.s1000d.org/S1000D_4-0-1/ent/ISOEntities">
%ISOEntities;
]>
<root>
<description> This is description &</description>
</root>
```
I am using the following XSLT for display:
```
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<html>
<body>
<xsl:template match="/">
<h1>Description:<xsl:value-of select="root/description" disable-output-escaping="yes"/></h1>
</xsl:template>
</body>
</html>
</xsl:stylesheet>
Am I parsing the encoded character node properly?
Could you please suggest what could be the problem with the XSLT code as it is not displaying anything when an encoded special character is there in the XML node?
Thank you very much for your support and time.
Regards,
AK
您需要详细说明您正在使用的XML解析器以及如何调用它
世界已经变得痴迷于安全,如今许多解析器默认关闭外部实体扩展,即使有一个应该完全安全的公共ID。相当多的解析器完全忽略DTD。