https://bugzilla.novell.com/show_bug.cgi?id=450797


           Summary: XslCompiledTransform doesn't preserve xsl:text
                    containing only whitespace
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


If you Load a Xsl transform via XslCompiledTransform.Load using one of the
XmlReader overloads, xsl:text elements that contain only whitespace do not
cause the whitespace to appear in the output.  XslTransform does not have this
problem.

I'll be attaching a proposed patch with a test case included.  All I changed
was to have XslCompiledTransform.Load create the XPathDocument with the
XmlSpace.Preserve tag in the same way that XslTransform.Load does.  Here's a
test (which will also be in the patch file):

[Test]
public void XslTextElement_PreservesWhitespace ()
{
        XslCompiledTransform xslt = new XslCompiledTransform ();
        xslt.Load (new XmlTextReader (new StringReader (@"
<xsl:stylesheet
  xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"";
  version=""1.0"">
  <xsl:output method='text' omit-xml-declaration='yes'/>
  <xsl:template match='foo'>
    <xsl:text> </xsl:text>
  </xsl:template>
</xsl:stylesheet>")));
        StringWriter sw = new StringWriter ();
        xslt.Transform (new XmlTextReader (new StringReader
(@"<foo>bar</foo>")), null, sw);
        Assert.AreEqual (" ", sw.ToString ());
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to