XML/HTML serializers should have default m_escapeSetting = true ---------------------------------------------------------------
Key: XALANJ-2218 URL: http://issues.apache.org/jira/browse/XALANJ-2218 Project: XalanJ2 Type: Bug Components: Serialization Versions: Latest Development Code, 2.6 Environment: I have problem with code bundled in Java 5 as well as the latest development version Reporter: Libor Valenta I started using XSLTC but I have problem with results it produces. I have XML: <a>&<b/>&</a> XSL: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="no" omit-xml-declaration="yes" /> <xsl:template match="/"> <result> <xsl:apply-templates /> </result> </xsl:template> <xsl:template match="b"> <xsl:text disable-output-escaping="yes">&</xsl:text> </xsl:template> </xsl:stylesheet> I would expect to have in result (see processing instructions) [[Text: &], [ProcessingInstruction: <?javax.xml.transform.disable-output-escaping?>], [Text: &], [ProcessingInstruction: <?javax.xml.transform.enable-output-escaping?>], [Text: &]] not [[Text: &], [ProcessingInstruction: <?javax.xml.transform.disable-output-escaping?>], [Text: &], [ProcessingInstruction: <?javax.xml.transform.disable-output-escaping?>], [Text: &]] For example in org.apache.xml.serializer.ToXMLSAXHandler m_escapeSetting is by default false The start of <xsl:text disable-output-escaping="yes"> will call setEscaping(false) which return false - the old value At the end of </xsl:text> will be called setEscaping(false) - where false is the original value returned by previous call. m_escapeSetting will never be true, but most importantly the resulting DOM makes no sense. also org.apache.xalan.xsltc.runtime.StringValueHandler.setEscaping(boolean bool) looks fishy, I tnink it should retrurn the old value. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]