Пример #1
0
 /// <summary>
 /// 寻找子节点集合
 /// </summary>
 /// <param name="xpath"></param>
 /// <returns></returns>
 public XmlNodeList FindChildNodes(string xpath)
 {
     if (string.IsNullOrEmpty(xpath))
     {
         return(XMLReader.FindChildNodes(root));
     }
     else
     {
         var _item = XMLReader.FindNode(root, xpath);
         if (_item == null)
         {
             return(null);
         }
         return(XMLReader.FindChildNodes(_item));
     }
 }
Пример #2
0
 /// <summary>
 /// 采用xpath查询语句查找相应节点(与查询语句匹配的第一个节点), 查找的起始节点为document的根节点
 /// </summary>
 /// <param name="xpath">xpath查询语句,参见微软帮助</param>
 /// <returns>查找到的节点对象</returns>
 public XmlNode FindNode(string xpath)
 {
     return(XMLReader.FindNode(root, xpath));
 }