diff options
author | Ravi Pratap M <ravi@mono-cvs.ximian.com> | 2002-08-27 00:26:15 +0400 |
---|---|---|
committer | Ravi Pratap M <ravi@mono-cvs.ximian.com> | 2002-08-27 00:26:15 +0400 |
commit | e09e9032252b2a5d0fcf0df7c97744f3df8e3bdc (patch) | |
tree | 4e85e0a9c260ae0564a77671a53b4de34f0b40bb /mcs/class/System.XML/System.Xml | |
parent | 06a84330ee91181c66b80b5b53d55bf36881e319 (diff) |
2002-08-26 Ravi Pratap <ravi@ximian.com>
* XmlAttribute.cs (InnerText): Implement getting this property.
* XmlNode.cs (InnerText): Ensure that we append only values of
text nodes.
svn path=/trunk/mcs/; revision=7061
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r-- | mcs/class/System.XML/System.Xml/ChangeLog | 8 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlAttribute.cs | 20 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlNode.cs | 5 |
3 files changed, 28 insertions, 5 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 2dbe7e6c862..3aa3b3a2686 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,11 @@ +2002-08-26 Ravi Pratap <ravi@ximian.com> + + + * XmlAttribute.cs (InnerText): Implement getting this property. + + * XmlNode.cs (InnerText): Ensure that we append only values of + text nodes. + 2002-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com> * XmlWriter.cs: made ws and namespaceManager protected. mcs has a bug diff --git a/mcs/class/System.XML/System.Xml/XmlAttribute.cs b/mcs/class/System.XML/System.Xml/XmlAttribute.cs index 70419b6c593..56e8658f4d5 100644 --- a/mcs/class/System.XML/System.Xml/XmlAttribute.cs +++ b/mcs/class/System.XML/System.Xml/XmlAttribute.cs @@ -8,6 +8,7 @@ // using System; +using System.Text; namespace System.Xml { @@ -46,17 +47,30 @@ namespace System.Xml } } - [MonoTODO] + [MonoTODO ("Setter")] public override string InnerText { get { - throw new NotImplementedException (); - } + StringBuilder builder = new StringBuilder (); + AppendChildValues (this, builder); + return builder.ToString (); + } set { throw new NotImplementedException (); } } + private void AppendChildValues (XmlNode parent, StringBuilder builder) + { + XmlNode node = parent.FirstChild; + + while (node != null) { + builder.Append (node.Value); + AppendChildValues (node, builder); + node = node.NextSibling; + } + } + [MonoTODO ("Setter.")] public override string InnerXml { get { diff --git a/mcs/class/System.XML/System.Xml/XmlNode.cs b/mcs/class/System.XML/System.Xml/XmlNode.cs index 4df1845b3a5..d4d39a77aef 100644 --- a/mcs/class/System.XML/System.Xml/XmlNode.cs +++ b/mcs/class/System.XML/System.Xml/XmlNode.cs @@ -77,12 +77,13 @@ namespace System.Xml set { throw new NotImplementedException (); } } - private void AppendChildValues(XmlNode parent, StringBuilder builder) + private void AppendChildValues (XmlNode parent, StringBuilder builder) { XmlNode node = parent.FirstChild; while (node != null) { - builder.Append (node.Value); + if (node.NodeType == XmlNodeType.Text) + builder.Append (node.Value); AppendChildValues (node, builder); node = node.NextSibling; } |