bugDotGNU Portable.NET - Bugs: bug #14261, XmlTextReader.NodeType is wrong...

 
 

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

bug #14261: XmlTextReader.NodeType is wrong after calling ReadElementString() on empty node

Submitted by:  Radek Polak <radekp>
Submitted on:  Tue 23 Aug 2005 06:56:35 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 23 Aug 2005 12:35:18 PM UTC, comment #3:

patch and testcase applied to cvs 08/23/2005.

Klaus Treichel <ktreichel>
Project Administrator
Tue 23 Aug 2005 07:03:15 AM UTC, comment #2:

Please forget the copy/pasted program because Savannah removed all xml stuff from it. Unpack the .zip archive in attachment instead.

Radek Polak <radekp>
Project Member
Tue 23 Aug 2005 07:00:26 AM UTC, comment #1:

Ouch the xml string should be: <doc><text/></doc>
In attached file it's all right (savannah did something evil with xml?)

Radek Polak <radekp>
Project Member
Tue 23 Aug 2005 06:56:35 AM UTC, original submission:

using System;
using System.IO;
using System.Xml;

class NodeTypeTest
{
// Check if XmlTextReader.NodeType after ReadElementString() on empty element is set well.
static void Main()
{
string xml = "<doc><text/></doc>";
XmlTextReader r = new XmlTextReader(new StringReader(xml));
r.Read();
r.Read();
r.ReadElementString(); // read contents of <text/> tag

Console.WriteLine("NodeType after ReadElementString()");
Console.WriteLine("is: " + r.NodeType);
Console.WriteLine("should be: " + XmlNodeType.EndElement);
if(r.NodeType == XmlNodeType.EndElement)
Console.WriteLine("Everything is OK");
else
Console.WriteLine("It's bugged");
}
}

compile with cscc -o node_type.exe -l System.Xml node_type.cs

Output from .NET:
NodeType after ReadElementString()
is: EndElement
should be: EndElement
Everything is OK

Output from Portable .NET:
$ ilrun.exe node_type.exe
NodeType after ReadElementString()
is: Element
should be: EndElement
It's bugged

Radek Polak <radekp>
Project Member

 

Attached Files
file #3394:  test.patch added by radekp (1007B - application/octet-stream - Test for this bug that should go in pnetlib/test/System.Xml/TestXmlTextReader.cs)
file #3393:  node_type.patch added by radekp (391B - application/octet-stream - Patch to fix this bug - we forgot to read the node )
file #3392:  node_type.zip added by radekp (2KiB - application/zip - Test program for this bug)

 

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 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 23 Aug 2005 12:35:18 PM UTCktreichelStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Tue 23 Aug 2005 09:43:27 AM UTCradekpAttached File-=>Added test.patch, #2855
Tue 23 Aug 2005 09:09:07 AM UTCradekpAttached File-=>Added node_type.patch, #2854
Tue 23 Aug 2005 06:56:36 AM UTCradekpAttached File-=>Added node_type.zip, #2853

Back to the top


Powered by Savane 3.1-cleanup1