You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by ywj <yw...@mails.tsinghua.edu.cn> on 2002/05/30 15:05:11 UTC

how to put single quote in the content of a node or an attriubte?

Hi, 
    Here is an problem about the character entity. We know the following characters must be replaced with their character entities when existing in the content of a node:
    &    -- &amp;
    '    -- &apos;
    >    -- &gt;
    <    -- &lt;
    "    -- &quot;

    Then I use the these entities in the xslt. they all work well except the single quote when the xslt file is used to transform xml files. Whenever I use &apos; or &#39; or "'", the transforming thread throw exception with the message as follows:
javax.xml.transform.TransformerException: misquoted literal... expected single quote! 
.........

    My xslt file is as follows:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match= "/" >
<xsl:value-of select="&apos;" />
</xsl:template>
</xsl:stylesheet>
 
    the version of xalan is xalan-j_2_2_D14.
    So who know the reason? and how can I add single quote into the content of a node?
    Thank you!

    regards!

Yang Wenjun