Author: atsushi
Date: 2005-03-04 00:41:14 -0500 (Fri, 04 Mar 2005)
New Revision: 41425
Modified:
trunk/mcs/class/System.XML/System.Xml/ChangeLog
trunk/mcs/class/System.XML/System.Xml/XmlDocument.cs
Log:
2005-03-03 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlDocument.cs : In ReadNode(), on EntityReference node, when
XmlReader can resolve entity, it expands entity and apppend
children into the entity reference. Patch by Konstantin Triger.
Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog 2005-03-04 05:12:26 UTC
(rev 41424)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog 2005-03-04 05:41:14 UTC
(rev 41425)
@@ -1,5 +1,11 @@
2005-03-03 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * XmlDocument.cs : In ReadNode(), on EntityReference node, when
+ XmlReader can resolve entity, it expands entity and apppend
+ children into the entity reference. Patch by Konstantin Triger.
+
+2005-03-03 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* XmlTextWriter.cs : For duplicating namespace mapping, it should
create another prefix without throwing an exception.
Modified: trunk/mcs/class/System.XML/System.Xml/XmlDocument.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlDocument.cs 2005-03-04
05:12:26 UTC (rev 41424)
+++ trunk/mcs/class/System.XML/System.Xml/XmlDocument.cs 2005-03-04
05:41:14 UTC (rev 41425)
@@ -862,6 +862,23 @@
throw new XmlException ("Reference to
undeclared entity was found.");
n = CreateEntityReference (reader.Name);
+ // IF argument XmlReader can resolve entity,
+ // ReadNode() also fills children _from it_.
+ // In this case, it is not from doctype node.
+ // (it is kind of sucky design, but it happens
+ // anyways when we modify doctype node).
+ //
+ // It does not happen when !CanResolveEntity.
+ // (In such case AppendChild() will resolve
+ // entity content, as XmlEntityReference does.)
+ if (reader.CanResolveEntity)
+ {
+ reader.ResolveEntity ();
+ reader.Read ();
+ for (XmlNode child; reader.NodeType !=
XmlNodeType.EndEntity && ((child = ReadNode (reader)) != null);)
+ n.InsertBefore (child, null,
false, false);
+ reader.Read (); // skip EndEntity
+ }
break;
case XmlNodeType.SignificantWhitespace:
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches