dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bugs #10853] XmlTextReader does not translate entitie


From: Erich Kitzmüller
Subject: [Pnet-developers] [bugs #10853] XmlTextReader does not translate entities in values
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7) Gecko/20040803 Firefox/0.9.3

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.

/**************************************************************************/
[bugs #10853] Latest Modifications:

Changes by: 
                Erich Kitzmüller <address@hidden>
'Date: 
                Son 07.11.2004 at 00:11 (GMT)

------------------ Additional Follow-up Comments ----------------------------
This is what XmlTextReader.cs from the mono project says:

 // LAMESPEC: Orthodox XML reader should normalize attribute values    

and therefore mono normalizes attributes whether or not Normalize is set. Next 
time I have access to a machine running Windows, I will double-check how MS 
.net does it.

The XML specification says:
"Before the value of an attribute is passed to the application or checked for 
validity, the XML processor MUST normalize the attribute value by applying the 
algorithm below, or by using some other method such that the value passed to 
the application is the same as that produced by the algorithm."






/**************************************************************************/
[bugs #10853] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10853>
Project: DotGNU Portable.NET
Submitted by: Erich Kitzmüller
On: Mon 01.11.2004 at 01:31

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open


Summary:  XmlTextReader does not translate entities in values

Original Submission:  See the following example; it should output "nächster", 
but outputs "n&#228;chster"


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

public class XmlDemo {
        public static void Main() {
                StringReader sr = new StringReader("<x 
value="n&#228;chster"/>");
                XmlTextReader xr = new XmlTextReader (sr);
                xr.Read();
                xr.MoveToAttribute("value");
                Console.Out.WriteLine(xr.Value);
        }
}


Follow-up Comments
------------------


-------------------------------------------------------
Date: Son 07.11.2004 at 00:11       By: Erich Kitzmüller <ammoq>
This is what XmlTextReader.cs from the mono project says:

 // LAMESPEC: Orthodox XML reader should normalize attribute values    

and therefore mono normalizes attributes whether or not Normalize is set. Next 
time I have access to a machine running Windows, I will double-check how MS 
.net does it.

The XML specification says:
"Before the value of an attribute is passed to the application or checked for 
validity, the XML processor MUST normalize the attribute value by applying the 
algorithm below, or by using some other method such that the value passed to 
the application is the same as that produced by the algorithm."

-------------------------------------------------------
Date: Sam 06.11.2004 at 23:29       By: Erich Kitzmüller <ammoq>
Strange. The property XmlTextReader.Normalization is responsible for that, and 
default is false (MSDN says so). So, what portable.net does, is correct. (if I 
insert "xr.Normalization = true;" in the example, it works).
But Mono shows a different behaviour, and I'm quite sure so does MS .net.













For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10853>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]