2003-07-26 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
authorAtsushi Eno <atsushieno@gmail.com>
Sat, 26 Jul 2003 08:47:54 +0000 (08:47 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Sat, 26 Jul 2003 08:47:54 +0000 (08:47 -0000)
* XmlAttribute.cs : .ctor() shouldallow localName "xml" (not prefix)
  with http://www.w3.org/XML/1998/namespace.
* XmlEntity.cs : patch by Aleksey Sanin. InnerText is now supported.
* XmlNode.cs : InnerText should handle CDATA and whitespaces.
* XmlTextReader.cs : Should allow " (#PCDATA)* " in ReadContentSpec().
* XmlTextWriter.cs : Quick fix for accepting (and writing) same-named
  attributes (as MS.NET does). It isn't good way and I may change it.

svn path=/trunk/mcs/; revision=16702

mcs/class/System.XML/System.Xml/ChangeLog
mcs/class/System.XML/System.Xml/XmlAttribute.cs
mcs/class/System.XML/System.Xml/XmlEntity.cs
mcs/class/System.XML/System.Xml/XmlNode.cs
mcs/class/System.XML/System.Xml/XmlTextReader.cs
mcs/class/System.XML/System.Xml/XmlTextWriter.cs

index 016f6ba077fcd39d822f11d8c0d012176bdbc989..4ba55f75f69179aee2e90081e8531dbbae961c61 100644 (file)
@@ -1,3 +1,13 @@
+2003-07-26  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
+
+       * XmlAttribute.cs : .ctor() shouldallow localName "xml" (not prefix)
+         with http://www.w3.org/XML/1998/namespace.
+       * XmlEntity.cs : patch by Aleksey Sanin. InnerText is now supported.
+       * XmlNode.cs : InnerText should handle CDATA and whitespaces.
+       * XmlTextReader.cs : Should allow " (#PCDATA)* " in ReadContentSpec().
+       * XmlTextWriter.cs : Quick fix for accepting (and writing) same-named
+         attributes (as MS.NET does). It isn't good way and I may change it.
+
 2003-07-24  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
 
        * DTDObjectModel.cs : Added DTDEntityDeclarationCollection and
index 481abc8ff9667ffdbf61307cb18eac4bcce74401..52afc6e1fff792fb08fe73bfa75073dde6e68a04 100644 (file)
@@ -46,8 +46,7 @@ namespace System.Xml
                        if (prefix == "xmlns" || (prefix == "" && localName == "xmlns"))
                                if (namespaceURI != XmlNamespaceManager.XmlnsXmlns)
                                        throw new ArgumentException ("Invalid attribute namespace for namespace declaration.");
-                       else if (prefix == "xml" || (prefix == "" && localName == "xml"))
-                               if (namespaceURI != XmlNamespaceManager.XmlnsXml)
+                       else if (prefix == "xml" && namespaceURI != XmlNamespaceManager.XmlnsXml)
                                        throw new ArgumentException ("Invalid attribute namespace for namespace declaration.");
 
                        // There are no means to identify the DOM is namespace-
index ac597b8b3935fa55ee6445340b5c711682a9019e..b1f82dec7b9c8c3f68c3c3cc654308b07bcc041a 100755 (executable)
@@ -43,9 +43,8 @@ namespace System.Xml
                        get {  return baseUri; }
                }
 
-               [MonoTODO]
                public override string InnerText {
-                       get { throw new NotImplementedException (); }
+                       get { return base.InnerText; }
                        set { throw new InvalidOperationException ("This operation is not supported."); }
                }
 
index 20b256dbaeadc4ec5f6b6f30ff9cfdefca723d8d..79ef3e1e4a2ba6b0cf32cd936dad5f2bfd847715 100644 (file)
@@ -83,14 +83,20 @@ namespace System.Xml
 
                private void AppendChildValues (XmlNode parent, StringBuilder builder)
                {
-                       XmlNode node = parent.FirstChild;
-
-                       while (node != null) {
-                               if (node.NodeType == XmlNodeType.Text)
-                                       builder.Append (node.Value);
-                               AppendChildValues (node, builder);
-                               node = node.NextSibling;
-                       }
+                       XmlNode node = parent.FirstChild;\r
+\r
+                       while (node != null) {\r
+                               switch (node.NodeType) {
+                               case XmlNodeType.Text:
+                               case XmlNodeType.CDATA:
+                               case XmlNodeType.SignificantWhitespace:
+                               case XmlNodeType.Whitespace:
+                                       builder.Append (node.Value);\r
+                                       break;\r
+                               }\r
+                               AppendChildValues (node, builder);\r
+                               node = node.NextSibling;\r
+                       }\r
                }
 
                public virtual string InnerXml {
index f49c41d60074ed206f6be2a4d3e76d968285784c..7b5dd726f7e87e439342d00ab34799b999d32df0 100644 (file)
@@ -2074,6 +2074,8 @@ namespace System.Xml
                                                Expect ('*');
                                                model.Occurence = DTDOccurence.ZeroOrMore;
                                        }
+                                       else if (PeekChar () == '*')
+                                               Expect ('*');
                                } else {
                                        // Non-Mixed Contents
                                        model.ChildModels.Add (ReadCP (decl));
index d3076e7d682ea46f3b5f2b2acad66c50d2c57eee..de7e8462a1a21a799a5bc149cd4542d90af71904 100644 (file)
@@ -598,9 +598,9 @@ namespace System.Xml
                                formatSpace = " ";
 
                        // If already written, then break up.
-                       if (checkMultipleAttributes &&
-                               writtenAttributes.Contains (formatPrefix + localName))
-                               return;
+//                     if (checkMultipleAttributes &&
+//                             writtenAttributes.Contains (formatPrefix + localName))
+//                             return;
 
                        w.Write ("{0}{1}{2}={3}", formatSpace, formatPrefix, localName, quoteChar);
                        if (checkMultipleAttributes)