bugDotGNU Portable.NET - Bugs: bug #4194, XmlReader.ReadAttributeValue...

 
 

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

bug #4194: XmlReader.ReadAttributeValue doesn't work properly

Submitted by:  Thong Nguyen <tum>
Submitted on:  Sat 05 Jul 2003 12:27:19 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat 05 Jul 2003 10:52:35 AM UTC, comment #1:

fixed.

Adam Ballai <minddog>
Project Member
Sat 05 Jul 2003 12:27:19 AM UTC, original submission:

A call to ReadAttributeValue should move the reader into a state where you can potentially read nodes "inside" an attribute. If the attribute only contains text (no entity references etc) then ReadAttributeValue should "move" the reader into a a text node.

Here's some code to demonstrate what I mean:

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

public class TestXml
{
public static void Main()
{
string xml;

xml = @"<?xml version='1.0'?>
<element a1='pok' a2='wer'/>
";

XmlReader reader = new XmlTextReader(new StringReader(xml));

for (;;)
{
reader.MoveToContent();

if (reader.NodeType == XmlNodeType.Element)
{
reader.MoveToFirstAttribute();

reader.ReadAttributeValue();

Console.WriteLine(reader.NodeType);

return;
}
}
}
}

It should print out "Text" but it prints out "Attribute".

Thong Nguyen <tum>
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):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Sat 05 Jul 2003 10:52:35 AM UTCminddogOpen/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1