You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by loic tregan <lt...@hotmail.com> on 2000/11/03 21:29:15 UTC
bug: incorrect \n added during processing
Hello,
I think I've found a bug in Xalan.
The XML is :
<root />
the XSL is:
<html>
<body>
<input>
<xsl:if test="true" >
</xsl:if>
</input>phone
</body>
</html>
->note
1)that phone is following the input with no space between.
2) this is a typical output of XMLSerializer in indent mode.
HTML output should be :
... <input>phone...
Instead it is:
... <input>
phone...
->note that a \n has been a added after the <input>, and I think it is a
bug. When displayed by the browser, this \n appears as a space and may
modify seriously the HTML (the cell way not be wide enough, and "phone" is
not displayed on the same line of the input).
My current workaround is to use non-indented XSL.
PS: I've not subscribe (when newsgroups will be available?) to the mailing
list, please send me a copy of any mail.
please find below the source code and exact output :
static void TestXSLIF_reported() throws Exception{
// create an XSL
String XSL =
"<xsl:stylesheet version=\"1.0\"
xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"
+"<xsl:template match=\"/\">"
+"<html>"
+"<body>"
+"<input><xsl:if test=\"true\" >\n</xsl:if></input>phone"
+"</body>"
+"</html>"
+"</xsl:template>"
+"</xsl:stylesheet>";
// create a dummy XML
String XML = "<root />";
// apply XSL
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
XSLTInputSource xslSrc = new XSLTInputSource( new StringReader(XSL) );
XSLTInputSource xmlSrc = new XSLTInputSource( new StringReader(XML) );
XSLTResultTarget target = new XSLTResultTarget( System.out );
StylesheetRoot stylesheet = processor.processStylesheet(xslSrc);
stylesheet.setOutputMethod( "HTML" );
stylesheet.process(processor, xmlSrc, target);
}
output:
----HTML----
<html><body><input>
phone</body></html>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.