bugDotGNU Portable.NET - Bugs: bug #12076, XmlNode.SelectSingleNode throws...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #12076: XmlNode.SelectSingleNode throws exception

Submitter:  Heiko Weiss <brubbel>
Submitted:  Mon 21 Feb 2005 03:08:14 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Tue 22 Feb 2005 07:38:28 AM UTC, comment #2: 


It thows:

System.ArgumentOutOfRangeException: Array Position oder Laenge ist ausserhalb des gueltigen Bereiches
Parameter Name: index
        at System.Collections.ArrayList.get_Item(Int32) in ./System/Collections/ArrayList.cs:238
        at System.Xml.Private.SelectNodeList.Item(Int32) in ./Private/SelectNodeList.cs:78
        at System.Xml.XmlNodeList.get_ItemOf(Int32) in ./XmlNodeList.cs:47
        at System.Xml.XmlNode.SelectSingleNode(String, XmlNamespaceManager) in ./XmlNode.cs:1043
        at System.Xml.XmlNode.SelectSingleNode(String) in ./XmlNode.cs:1030

Heiko Weiss <brubbel>
Group Member
Tue 22 Feb 2005 07:30:21 AM UTC, comment #1: 

What exception did it throw ?.

[gopal@gopal tests]$ cat xpath.cs

using System;
using System.Xml;

public class XYZ
{
public static void Main ()
{
XmlDocument xmlDoc = new XmlDocument ();
xmlDoc.Load("xpath.xml");
XmlNode root = xmlDoc.FirstChild;
foreach (XmlNode node in root.ChildNodes)
{
XmlNode nodeSub = node.SelectSingleNode ("Dialogs");
if (null != nodeSub)
{
Console.WriteLine ("[" + nodeSub.OuterXml + "]");
}
}
}
}
[gopal@gopal tests]$ cscc -lSystem.Xml xpath.cs
[gopal@gopal tests]$ ilrun a.out
[<Dialogs><Dialog><Assembly>this</Assembly><ClassName>TestDialog1</ClassName></ialog><Dialog><Assembly>this</Assembly><ClassName>TestDialog2</ClassName></Dialg></Dialogs>]

???.


Anonymous
Mon 21 Feb 2005 03:08:14 PM UTC, original submission:  


if I try XmlNode.SelectSingleNode it throws an exception.
See XmlFile below:
I try:

XmlDocument xmlDoc;

XmlNode root = xmlDoc.FirstChild;
foreach( XmlNode node in root.ChildNodes ) {
  XmlNode nodeSub = node.SelectSingleNode( "Dialogs" );
  if( null != nodeSub ) {
    Console.WriteLine( nodeSub.OuterXml );
  }
}

XmlFile:

<MainTasks>

<MainTaskHelp>
  <Dialogs>
    <Dialog>
      <Assembly>this</Assembly>
      <ClassName>TestDialog1</ClassName>
    </Dialog>

    <Dialog>
      <Assembly>this</Assembly>
      <ClassName>TestDialog2</ClassName>
    </Dialog>
   
  </Dialogs>
 
</MainTaskHelp>

</MainTasks>

Heiko Weiss <brubbel>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-02-22 t3rmin4t0r StatusNone Fixed
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code