From: Gonzalo Paniagua Javier Date: Wed, 1 Sep 2004 19:58:34 +0000 (-0000) Subject: 2004-09-01 Gonzalo Paniagua Javier X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=a0ea59a1e1c35eb6ff8522e6bc090345acacd0ec;p=mono.git 2004-09-01 Gonzalo Paniagua Javier * 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 --- diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog index dace1da7b57..aada87a6c2d 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog @@ -1,3 +1,13 @@ +2004-09-01 Gonzalo Paniagua Javier + + * 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 * Xml.cs: use MapPath in DocumentSource and documentContent. Fixes diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs index ff9aacac78b..e2bca533f8f 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs @@ -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; } diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/XmlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/XmlBuilder.cs index 4aaa88a7580..445e87143d2 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/XmlBuilder.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/XmlBuilder.cs @@ -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) // // @@ -29,14 +31,16 @@ 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); } } } +