diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-09-01 23:58:34 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-09-01 23:58:34 +0400 |
commit | a0ea59a1e1c35eb6ff8522e6bc090345acacd0ec (patch) | |
tree | ff0e1be73412592d1b38bfb1182e57fba450abbf /mcs/class/System.Web | |
parent | 493013aecdb7ed04d9262da4dd62b8ca3776b430 (diff) |
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.
svn path=/branches/mono-1-0/mcs/; revision=33177
Diffstat (limited to 'mcs/class/System.Web')
3 files changed, 37 insertions, 7 deletions
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 <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 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); } } } + |