+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
[WebSysDescription ("The XML content that is transformed for the XML Webcontrol.")]
public string DocumentContent {
get {
- return String.Empty;
+ return documentContent;
}
set {
document = null;
private void LoadXpathDoc ()
{
if (documentContent != null && documentContent.Length > 0) {
- xpathDoc = new XPathDocument (new StringReader (MapPathSecure (documentContent)));
+ xpathDoc = new XPathDocument (new StringReader (documentContent));
return;
}
// 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)
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);
}
}
}
+