2004-09-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 1 Sep 2004 19:58:34 +0000 (19:58 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 1 Sep 2004 19:58:34 +0000 (19:58 -0000)
* Xml.cs: fixed get_DocumentContent (it was returning "" always!) and
don't call MapPathSecure on the content itself.

* XmlBuilder.cs: handle XML documents written inside asp:xml. The
document is checked at parse time and will be checked again at run time.

Fixes bug #63828.

svn path=/branches/mono-1-0/mcs/; revision=33177

mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs
mcs/class/System.Web/System.Web.UI.WebControls/XmlBuilder.cs

index dace1da7b579ecc1937977c8f9cd9f7b3683e159..aada87a6c2d080f0bba94121e74b11bf49c49d5a 100644 (file)
@@ -1,3 +1,13 @@
+2004-09-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * Xml.cs: fixed get_DocumentContent (it was returning "" always!) and
+       don't call MapPathSecure on the content itself.
+       
+       * XmlBuilder.cs: handle XML documents written inside asp:xml. The
+       document is checked at parse time and will be checked again at run time.
+
+       Fixes bug #63828.
+
 2004-08-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * Xml.cs: use MapPath in DocumentSource and documentContent. Fixes
index ff9aacac78b26cc2527b1a0df472acadd783785f..e2bca533f8f7cbba00b64d8d9b1d18c0c321f938 100644 (file)
@@ -116,7 +116,7 @@ namespace System.Web.UI.WebControls
                [WebSysDescription ("The XML content that is transformed for the XML Webcontrol.")]
                public string DocumentContent {
                        get {
-                               return String.Empty;
+                               return documentContent;
                        }
                        set {
                                document = null;
@@ -192,7 +192,7 @@ namespace System.Web.UI.WebControls
                private void LoadXpathDoc ()
                {
                        if (documentContent != null && documentContent.Length > 0) {
-                               xpathDoc = new XPathDocument (new StringReader (MapPathSecure (documentContent)));
+                               xpathDoc = new XPathDocument (new StringReader (documentContent));
                                return;
                        }
 
index 4aaa88a7580ab44ff623824f2cfb6224a525a689..445e87143d25d0dadd98060f9e12d3ca82d3172f 100644 (file)
@@ -2,8 +2,10 @@
 // System.Web.UI.WebControls.XmlBuilder.cs
 //
 // Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//     Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//     Gonzalo Paniagua Javier (gonzalo@novell.com)
 //
+// Copyright (c) 2004 Novell, Inc. (http://www.novell.com)
 //
 
 //
 
 using System;
 using System.Collections;
+using System.Web.Compilation;
 using System.Web.UI;
+using System.Xml;
 
 namespace System.Web.UI.WebControls
 {
-       internal class XmlBuilder : ControlBuilder
+       class XmlBuilder : ControlBuilder
        {
                public override void AppendLiteralString (string s)
-               {       
+               {
                }
 
                public override Type GetChildControlType (string tagName, IDictionary attribs)
@@ -49,10 +53,26 @@ namespace System.Web.UI.WebControls
                        return true;
                }
 
-               [MonoTODO ("find out what this does and implement")]
                public override void SetTagInnerText (string text)
                {
-                       throw new NotImplementedException ();
+                       string trimmed = text.Trim ();
+                       if (trimmed == "")
+                               return;
+
+                       XmlDocument doc = new XmlDocument ();
+                       try {
+                               doc.LoadXml (text);
+                       } catch (XmlException xmle) {
+                               Location newloc = new Location (location);
+                               if (xmle.LineNumber >= 0)
+                                       newloc.BeginLine += xmle.LineNumber - 1;
+
+                               location = newloc;
+                               throw;
+                       }
+
+                       base.AppendLiteralString (trimmed);
                }
        }
 }
+