[Mono-bugs] [Bug 594877] New: XElement.XPathSelectElement throwing System.NullReferenceException with xpath ".//objsur[@t='o']"

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 8 12:29:49 EDT 2010


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

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


           Summary: XElement.XPathSelectElement throwing
                    System.NullReferenceException with xpath
                    ".//objsur[@t='o']"
    Classification: Mono
           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: tom_hindle at sil.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=353231)
 --> (http://bugzilla.novell.com/attachment.cgi?id=353231)
Test for XPathSelectElement

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

string data = "<rt> <objsur t=\"o\"
guid=\"06974d9a-ff86-4e1c-a3e5-7ce8c961dcb9\" /> </rt>";
XElement xeOldOwner = XElement.Parse(data);
string xpathOld = String.Format(".//objsur[@t='o']");
XElement xeOldRef = xeOldOwner.XPathSelectElement(xpathOld);


Attaching test case

Reproducible: Always

Steps to Reproduce:
1. Compile are attached run test case
2.
3.
Actual Results:  
Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at System.Xml.Linq.XNodeNavigator.get_NodeType () [0x00023] in
/home/hindlet/src/custom-mono/mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeNavigator.cs:155 
  at System.Xml.XPath.NodeTypeTest.Match (IXmlNamespaceResolver nsm,
System.Xml.XPath.XPathNavigator nav) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Expression.cs:1613 
  at System.Xml.XPath.AxisIterator.MoveNextCore () [0x00005] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Iterator.cs:823 
  at System.Xml.XPath.BaseIterator.MoveNext () [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Iterator.cs:96 
  at System.Xml.XPath.SimpleSlashIterator.MoveNextCore () [0x0002e] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Iterator.cs:863 
  at System.Xml.XPath.BaseIterator.MoveNext () [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Iterator.cs:96 
  at System.Xml.XPath.SlashIterator.MoveNextCore () [0x0011b] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Iterator.cs:995 
  at System.Xml.XPath.BaseIterator.MoveNext () [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Iterator.cs:96 
  at System.Xml.XPath.SortedIterator..ctor (System.Xml.XPath.BaseIterator iter)
[0x00033] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Iterator.cs:888 
  at System.Xml.XPath.ExprSLASH2.Evaluate (System.Xml.XPath.BaseIterator iter)
[0x00074] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Expression.cs:1320 
  at System.Xml.XPath.Expression.EvaluateNodeSet (System.Xml.XPath.BaseIterator
iter) [0x00025] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Expression.cs:507 
  at System.Xml.XPath.CompiledExpression.EvaluateNodeSet
(System.Xml.XPath.BaseIterator iter) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/Expression.cs:170 
  at System.Xml.XPath.XPathNavigator.Select (System.Xml.XPath.XPathExpression
expr, IXmlNamespaceResolver ctx) [0x0001d] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs:604 
  at System.Xml.XPath.XPathNavigator.Select (System.Xml.XPath.XPathExpression
expr) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs:594 
  at System.Xml.XPath.XPathNavigator.SelectSingleNode
(System.Xml.XPath.XPathExpression expression) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs:1004 
  at System.Xml.XPath.XPathNavigator.SelectSingleNode (System.String xpath,
IXmlNamespaceResolver nsResolver) [0x0000f] in
/home/hindlet/src/custom-mono/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs:999 
  at System.Xml.XPath.Extensions.XPathSelectElement (System.Xml.Linq.XNode
node, System.String xpath, IXmlNamespaceResolver nsResolver) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs:65 
  at System.Xml.XPath.Extensions.XPathSelectElement (System.Xml.Linq.XNode
node, System.String xpath) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs:60 
  at XPathSelectElementTest.MainClass.Main (System.String[] args) [0x0000d] in
/home/hindlet/Projects/XPathSelectElementTest/XPathSelectElementTest/XPathSelectElementTest.cs:17 
The application was terminated by a signal: SIGHUP

Expected Results:  
<objsur t="o" guid="06974d9a-ff86-4e1c-a3e5-7ce8c961dcb9" />

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