示例#1
0
        private TaggedXmlElement FindById(TaggedXmlElement parent, int id)
        {
            if (parent.Id == id)
            {
                return(parent);
            }

            foreach (var child in parent.Elements)
            {
                var match = FindById(child, id);
                if (match != null)
                {
                    return(match);
                }
            }

            return(null);
        }
示例#2
0
 public TaggedXmlDoc(XmlDocument doc, XmlSelector selector)
 {
     // tag each node using XPath selector
     this.doc = doc.Clone() as XmlDocument;
     Root     = TagNodeWithXPath(this.doc, selector);
 }
示例#3
0
 public TaggedXmlDoc(XmlDocument doc)
 {
     // tag each node incrementally
     this.doc = doc.Clone() as XmlDocument;
     Root     = TagNodeIncrementally(this.doc.DocumentElement, 0);
 }