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

Submitted by:  Heiko Weiss <brubbel>
Submitted on:  Mon 21 Feb 2005 03:08:14 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned 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>
Project 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>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 22 Feb 2005 05:30:00 PM UTCt3rmin4t0rStatusNone=>Fixed
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1