我的输入具有类似Í,Â,ÇÁ的重音字符,使用xslt版本1.0我需要渲染这些字符而不做任何更改.
例如:
input Í ÇÂME HOME
output Í ÇÂME HOME
我不想编码/更改那些重音字符,但我得到的输出就像 Ã? ÇÂME HOME
我观察到的是:
Í is converting to Ã?
Ç to Ç
 to Â
如果您观察到所有这些字符都转换为大写字母a,则使用其他字符(, ? ‡ )
任何人都可以帮助我我的样式表看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xsl:element name="root">
<xsl:value-of select="/../inputpath/msg"/>
<\xsl:element>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
用于转换xml的代码
public static String transformByXslt(final String input, final String styleSheet,
final Map<String, String> parameterMap, final ProductMetadata productMetadata,
final ProductInstance productInstance, final Map<String, Object> daoMap) throws TransformerException,
UnsupportedEncodingException, ValidationException, …Run Code Online (Sandbox Code Playgroud)