[Mono-bugs] [Bug 571336] New: XmlDocument XmlElement creation is broken.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jan 16 01:06:55 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=571336

http://bugzilla.novell.com/show_bug.cgi?id=571336#c0


           Summary: XmlDocument XmlElement creation is broken.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: Novell at pedriana.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=336960)
 --> (http://bugzilla.novell.com/attachment.cgi?id=336960)
MonoBug.cs -- demonstrates the bug.

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.6)
Gecko/20091201 Firefox/3.5.6

XmlDocument.Load is not using XmlDocument.CreateElement to create new elements.
This makes it not possible for the user to subclass XmlDocument and override
the CreateElement function successfully. 

The attached MonoBug.cs demonstrates the bug. MonoBug.cs loads a file called
MonoBugData.xml, the simple contents of which can be seen at the top of
MonBug.cs in some comments.

The bug doesn't occur with Mono 2.4 nor any known version of Microsoft .Net.

This bug is similar to bug #549839, which was acknowledged and fixed:
https://bugzilla.novell.com/show_bug.cgi?id=549839


Reproducible: Always

Steps to Reproduce:
Use XmlDocument.Load to load any XML file. It is supposed to use
XmlDocument.CreateElement to create nodes, but does not. The problem manifests
as a bug when using a subclass of XmlDocument which overrides the CreateElement
function, which doesn't get called.
Actual Results:  
In Mono 2.6.1 XmlDocument.CreateElement(...) method is not called during
execution of XmlDocument.Load(...) methods. XmlDocument.Load appears to be
creating elements directly.


Expected Results:  
XmlDocument Load method should use:
    public virtual XmlElement CreateElement(string prefix, string localName,
string namespaceURI);
method when creating XMLElement instances. It should not use XmlElement ctor
directly.

This is significant because the current behavior prevents the user from
overriding XmlDocument.CreateElement and an XmlDocument subclass. Also,
Microsoft .Net uses CreateElement.

-- 
Configure bugmail: http://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