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

Submitter:  Radek Polak <radekp>
Submitted:  Tue 23 Aug 2005 06:56:35 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned 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>
Group 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>
Group 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>
Group 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>
Group Member

 

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

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

 

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

Date Changed by Updated Field Previous Value => Replaced by
2005-08-23 ktreichel StatusNone Fixed
    Open/ClosedOpen Closed
2005-08-23 radekp Attached File- Added test.patch, #2855
2005-08-23 radekp Attached File- Added node_type.patch, #2854
2005-08-23 radekp Attached File- Added node_type.zip, #2853

Back to the top

Powered by Savane 3.15-94dd.
Corresponding source code