/// <summary> /// 设置到restrition file的某父级结点,以便调用 public bool Validate(string value, string childname) 检查各childname /// </summary> /// <param name="xpath">XPath格式为:名称1.子名称2.子名称3</param> /// <returns></returns> public bool SetParentPath(string xpath) { if (root.ChildrenByPath(xpath) == null) { return(false); } root = root.ChildrenByPath(xpath).First(); return(root.HasChildren); }