[Mono-bugs] [Bug 378239] New: Xslt Transform is losing nl

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 9 04:49:39 EDT 2008


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


           Summary: Xslt Transform is losing nl
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: albright at wesay.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


[Test]
public void Test()
{
    XslCompiledTransform transform = new XslCompiledTransform();

    StringReader xml = new StringReader(
@"<?xml version='1.0' encoding='UTF-8'?>
<test/>");

    StringReader xslt = new StringReader(
@"<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl '
'>
]>
<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='/'>
<xsl:text>&nl;Hello&nl;World</xsl:text>
</xsl:template>
</xsl:stylesheet>");

    XmlReaderSettings readerSettings = new XmlReaderSettings();
    readerSettings.ProhibitDtd = false;

    using (XmlReader xsltReader = XmlReader.Create(xslt, readerSettings))
    {
        XsltSettings settings = new XsltSettings(true, true);
        transform.Load(xsltReader, settings, new XmlUrlResolver());
        xsltReader.Close();
    }

    StringWriter output = new StringWriter();

    using (XmlReader xmlReader = XmlReader.Create(xml, readerSettings))
    {
        transform.Transform(xmlReader, new XsltArgumentList(), output);
        xmlReader.Close();
    }
    string expectedResult = @"
Hello
World";
    Assert.AreEqual(expectedResult,output.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.


More information about the mono-bugs mailing list