[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] pnetlib ChangeLog System.Xml/XmlReader.cs
From: |
Heiko Weiss |
Subject: |
[dotgnu-pnet-commits] pnetlib ChangeLog System.Xml/XmlReader.cs |
Date: |
Mon, 02 Feb 2009 10:20:31 +0000 |
CVSROOT: /sources/dotgnu-pnet
Module name: pnetlib
Changes by: Heiko Weiss <brubbel> 09/02/02 10:20:30
Modified files:
. : ChangeLog
System.Xml : XmlReader.cs
Log message:
fixed ReadElementString.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnetlib/ChangeLog?cvsroot=dotgnu-pnet&r1=1.2554&r2=1.2555
http://cvs.savannah.gnu.org/viewcvs/pnetlib/System.Xml/XmlReader.cs?cvsroot=dotgnu-pnet&r1=1.14&r2=1.15
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/pnetlib/ChangeLog,v
retrieving revision 1.2554
retrieving revision 1.2555
diff -u -b -r1.2554 -r1.2555
--- ChangeLog 1 Feb 2009 20:34:25 -0000 1.2554
+++ ChangeLog 2 Feb 2009 10:20:28 -0000 1.2555
@@ -1,3 +1,7 @@
+2009-02-02 Heiko Weiss <address@hidden>
+
+ * System.Xml/XmlReader.cs: fix ReadElementString because of fix in
ReadString
+
2009-02-01 Klaus Treichel <address@hidden>
* runtime/System/Globalization/CharUnicodeInfo.cs: Change conditional
Index: System.Xml/XmlReader.cs
===================================================================
RCS file: /sources/dotgnu-pnet/pnetlib/System.Xml/XmlReader.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- System.Xml/XmlReader.cs 28 Jan 2009 07:44:04 -0000 1.14
+++ System.Xml/XmlReader.cs 2 Feb 2009 10:20:30 -0000 1.15
@@ -167,33 +167,70 @@
// Read the contents of a text element string using a name.
public virtual String ReadElementString(String localname, String ns)
{
- if(MoveToContent() == XmlNodeType.Element &&
- LocalName == localname && NamespaceURI == ns)
+ if( (MoveToContent() != XmlNodeType.Element) ||
+ (LocalName != localname ) ||
+ (NamespaceURI == ns) )
{
- return ReadString();
+ throw new
XmlException(S._("Xml_IncorrectNode"));
}
+
+ if( !this.IsEmptyElement )
+ {
+ string ret = ReadString();
+ if (this.NodeType !=
XmlNodeType.EndElement)
+ {
throw new
XmlException(S._("Xml_IncorrectNode"));
}
+ this.Read();
+ return ret;
+ }
+ this.Read();
+ return string.Empty;
+ }
// Read the contents of a text element string using a qualified name.
public virtual String ReadElementString(String name)
{
- if(MoveToContent() == XmlNodeType.Element &&
Name == name)
+ if(MoveToContent() != XmlNodeType.Element ||
Name != name)
{
- return ReadString();
+ throw new
XmlException(S._("Xml_IncorrectNode"));
}
+
+ if( !this.IsEmptyElement )
+ {
+ string ret = ReadString();
+ if (this.NodeType !=
XmlNodeType.EndElement)
+ {
throw new
XmlException(S._("Xml_IncorrectNode"));
}
+ this.Read();
+ return ret;
+ }
+ this.Read();
+ return string.Empty;
+ }
// Read the contents of a text element.
public virtual String ReadElementString()
{
- if(MoveToContent() == XmlNodeType.Element)
+ if(MoveToContent() != XmlNodeType.Element)
{
- return ReadString();
+ throw new
XmlException(S._("Xml_IncorrectNode"));
}
+ if( !this.IsEmptyElement )
+ {
+ this.Read();
+ string ret = ReadString();
+ if (this.NodeType !=
XmlNodeType.EndElement)
+ {
throw new
XmlException(S._("Xml_IncorrectNode"));
}
+ this.Read();
+ return ret;
+ }
+ this.Read();
+ return string.Empty;
+ }
// Read an end element node and advance to the next node.
public virtual void ReadEndElement()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] pnetlib ChangeLog System.Xml/XmlReader.cs,
Heiko Weiss <=