[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


           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: ---

public void Test()
    XslCompiledTransform transform = new XslCompiledTransform();

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

    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='/'>

    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());

    StringWriter output = new StringWriter();

    using (XmlReader xmlReader = XmlReader.Create(xml, readerSettings))
        transform.Transform(xmlReader, new XsltArgumentList(), output);
    string expectedResult = @"

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