[Mono-bugs] [Bug 559459] New: Xml read error when using namespaces

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Dec 1 04:54:27 EST 2009



           Summary: Xml read error when using namespaces
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: avkekem at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.1
(KHTML, like Gecko) Chrome/ Safari/532.1

I have an attribute in an xml string with namespaces, where the attribute is
not seen by the XmlNodeReader

Reproducible: Always

Steps to Reproduce:
using System;
using System.Xml;
using System.IO;

class MainClass
    public static void Main (string[] args)
        string xml = "<div xmlns:bind=\"http://namespace.com/tt\"
><bind:value-of select=\"GetDataXml(.)\" /></div>";
        XmlDocument xmlDoc = new XmlDocument ();
        xmlDoc.LoadXml (xml);
        XmlReader r = new XmlNodeReader (xmlDoc.DocumentElement);
        while (r.Read ())
            if (r.Name == "bind:value-of")
                Console.WriteLine ("xml: " + r.ReadOuterXml());
                Console.WriteLine ("select att: " + r.GetAttribute ("select"));
                if (string.IsNullOrEmpty (r.GetAttribute ("select")))
                    throw new NotSupportedException ("missing or empty select
Actual Results:  
NotSupportedException is raised, that is, the select attribute is not seen.

xml: <bind:value-of select="GetDataXml(.)" xmlns:bind="http://namespace.com/tt"
select att: 
Unhandled Exception: System.NotSupportedException: missing or empty select

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