System.Web.UI.WebControls.XmlDataSource.GetXmlDocument C# (CSharp) Method

GetXmlDocument() public method

public GetXmlDocument ( ) : XmlDocument
return System.Xml.XmlDocument
		public XmlDocument GetXmlDocument ()
		{
			if (_documentNeedsUpdate)
				UpdateXml ();
			
			if (xmlDocument == null && EnableCaching)
				xmlDocument = GetXmlDocumentFromCache ();

			if (xmlDocument == null) {
				xmlDocument = LoadXmlDocument ();
				UpdateCache ();
			}

			return xmlDocument;
		}

Usage Example

        public override IHierarchicalEnumerable Select()
        {
            XmlNode root = _owner.GetXmlDocument();

            XmlNodeList nodes = null;

            if (!String.IsNullOrEmpty(_viewPath))
            {
                XmlNode node = root.SelectSingleNode(_viewPath);
                if (node != null)
                {
                    nodes = node.ChildNodes;
                }
            }
            else
            {
                if (_owner.XPath.Length > 0)
                {
                    nodes = root.SelectNodes(_owner.XPath);
                }
                else
                {
                    nodes = root.ChildNodes;
                }
            }

            return(new XmlHierarchicalEnumerable(nodes));
        }
All Usage Examples Of System.Web.UI.WebControls.XmlDataSource::GetXmlDocument