protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         this.xml = null;
     }
     base.Dispose(disposing);
 }
Ejemplo n.º 2
0
        /// <summary>
        ///	Required method for Designer support - do not modify
        ///	the contents of this method with the code editor.
        /// </summary>
        protected override void OnInit(EventArgs e)
        {
            System.Web.UI.WebControls.Xml control = new System.Web.UI.WebControls.Xml();
            control.DocumentSource = XmlDocument;
            control.TransformSource = XslDocument;
            this.Controls.Add(control);

            base.OnInit (e);
        }
Ejemplo n.º 3
0
 // <summary>
 // Applica la trasformazione XSLT all'xmlSource e scrive l'output sul controllo OutputAspXml
 // </summary>
 public static void ApplyXsltTransform(string xmlSource, string sPathXSLT, ref System.Web.UI.WebControls.Xml OutputAspXml)
 {
     try
     {
         XmlDocument oXmlDocument = new XmlDocument();
         oXmlDocument.LoadXml(xmlSource);
         OutputAspXml.XPathNavigator  = oXmlDocument.CreateNavigator();
         OutputAspXml.TransformSource = sPathXSLT;
     }
     catch (Exception ex)
     {
         //
         // Error
         //
         throw new Exception(ex.Message + " Errore durante ApplyXsltTransform()!", ex);
     }
 }
Ejemplo n.º 4
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            string key = String.Concat("RssFeed", this.PortletID.ToString());

            try
            {
                if (Common.Cache.IsCached(key) == false)
                {
            #if TRACE
                    Context.Trace.Write("RssFeed", String.Concat("Fetching ", XmlDocument));
            #endif
                    // Creates a new XmlDocument object
                    XmlDocument rss = new XmlDocument();

                    // Loads the RSS Feed from the passed URL
                    rss.Load(this.XmlDocument);

                    // create writer
                    System.IO.StringWriter stringWriter = new System.IO.StringWriter();

                    // writes XML content to writer
                    rss.WriteContentTo(new XmlTextWriter(stringWriter));

                    // the object cast is needed so the method is not ambiguous
                    Common.Cache.Add(key, (object)stringWriter.ToString(), DateTime.Now.AddDays(1));
                }

                // create XML transformation control
                System.Web.UI.WebControls.Xml rssfeed = new System.Web.UI.WebControls.Xml();

                // sets data for control
                rssfeed.DocumentContent = (string)Common.Cache[key];
                rssfeed.TransformSource = this.XslDocument;

                // write the HTML output to the writer.
                rssfeed.RenderControl(writer);
            }
            catch (Exception exc)
            {
                writer.Write("<center><strong>An error occured in the RSS Feed.</strong></center>");
                Trace.Warn("RssFeed", String.Concat("An error occured in ", this.Title, " \n\twith RSS URL ", this.XmlDocument, " \n\twith XSL URL ", this.XslDocument), exc);
                Common.Cache.Remove(key);
            }
        }
Ejemplo n.º 5
0
		private void createTreeMenu()
		{
			User user=new User(Session["userid"].ToString());
			this.ViewState["strItemsGrp"]   = "";
			this.ViewState["navpage"]       = "";
			this.ViewState["startitem"]     = "";
            string strDeptID = "";
            if ("" != user.SubDeptCode)
                strDeptID = user.SubDeptCode;
            else if ("" != user.DeptmentCode)
                strDeptID = user.DeptmentCode;
            else if ("" != user.UnitCode)
                strDeptID = user.UnitCode;
            if ("" == strDeptID || "" == user.RoleName)
                return;
			//找到角色节点和单元节点
            //string strXPath = "//Node[contains(Tag,'@类型=单位') and contains(Tag,'@代码={0}')]"
            //    +"/Nodes/Node[contains(Tag,'@类型=角色') and contains(Tag,'@名称={1}')]/Nodes/Node";
            //strXPath=string.Format(strXPath,strDeptID.ToLower(),user.RoleName);

            if (user.DsDeptRight == null)
            {
                this.Response.Write("<script language=\"javascript\">alert(\"系统故障,请检查管理权限文件是否正确!\");parent.parent.location.href=\"default.htm\";</script>");
                return;
            }

			//用user.TabDeptRight生成树结构
            Xml CtrlXmlLand = new Xml();
            CtrlXmlLand.Document = new XmlDataDocument(user.DsDeptRight);
            Response.ContentType = "text/xml";
            Response.Expires = -1;
            Response.Clear();
            Response.Write("<?xml   version='1.0'   encoding='GB2312'?>");
            Response.Write(CtrlXmlLand.Document.InnerXml);
            //Response.End();   
		}
 public override void Initialize(IComponent component)
 {
     ControlDesigner.VerifyInitializeArgument(component, typeof(Xml));
     this.xml = (Xml) component;
     base.Initialize(component);
 }
Ejemplo n.º 7
0
 public Book(Xml book)
 {
     string x = book.ToString();
 }
Ejemplo n.º 8
0
		public void SkinID ()
		{
			Xml xml = new Xml ();
			xml.SkinID = "Fake";
		}
Ejemplo n.º 9
0
		public void Focus ()
		{
			Xml xml = new Xml ();
			xml.Focus ();
		}
Ejemplo n.º 10
0
		public void XPathNavigatorInstance_1 () 
		{
			Xml xml = new Xml ();
			XmlDocument doc = new XmlDocument ();
			doc.LoadXml ("<document></document>");

			xml.Document = doc;

			XPathNavigator nav1 = xml.XPathNavigator;

			Assert.IsNull (nav1, "XPathNavigatorInstance_1");
		}
Ejemplo n.º 11
0
		public void XPathNavigable_2 ()
		{
			Xml xml = new Xml ();
			xml.XPathNavigator = new CustomXPathNavigator();
			Assert.AreEqual ("Test", xml.XPathNavigator.BaseURI, "XPathNavigable_2");
		}
Ejemplo n.º 12
0
		public void XPathNavigable_1 ()
		{
			Xml xml = new Xml ();
			XmlDocument doc = new XmlDocument ();
			xml.XPathNavigator = doc.CreateNavigator ();
			Assert.IsNotNull (xml.XPathNavigator);
		}
Ejemplo n.º 13
0
		public void Xml_InvalidDocument ()
		{
			Xml xml = new Xml ();
			xml.DocumentContent = "Hey";
			Assert.AreEqual ("Hey", xml.DocumentContent);
			xml.DocumentContent = "<hey></hey>";
			Assert.AreEqual ("<hey></hey>", xml.DocumentContent);

			xml.TransformSource = "test.xsl";
			Assert.AreEqual (null, xml.Transform, "ID");
		}
Ejemplo n.º 14
0
		[Test] public void Xml_Values ()
		{
			Xml xml = new Xml ();

			Assert.AreEqual ("", xml.DocumentContent, "V1");
			Assert.AreEqual (null, xml.Document, "V2");
			Assert.AreEqual ("", xml.DocumentSource, "V3");
			
			Assert.AreEqual (null, xml.Transform, "V4");
			Assert.AreEqual (null, xml.TransformArgumentList, "V5");
			Assert.AreEqual ("", xml.TransformSource, "V6");

			// Check that assignments to null, are mapped back into ""
			xml.DocumentContent = null;
			Assert.AreEqual ("", xml.DocumentContent, "V7");
			
			xml.TransformSource = null;
			Assert.AreEqual ("", xml.TransformSource, "V8");

			Assert.AreEqual (null, xml.Transform, "V9");
			Assert.AreEqual (false, xml.EnableTheming, "EnableTheming");
			Assert.AreEqual (String.Empty, xml.SkinID, "SkinID");
			Assert.AreEqual (null, xml.XPathNavigator, "XPathNavigator");
		}