public object GetSubNode(object parentElement, string childElementName) { XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(parentElement); if (xmlNode != null) { return((object)new MsXmlNodeEmulator(xmlNode.SelectSingleNode(childElementName) ?? throw new Exception("Не найден обязательный дочерний элемент \"" + childElementName + "\"."))); } return(InMetaXmlUtils.InteropSelectSingleNode(parentElement, childElementName) ?? throw new Exception("Не найден обязательный дочерний элемент \"" + childElementName + "\".")); }
internal static object SelectSingleNode(object node, string pattern) { XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(node); if (xmlNode == null) { return(InMetaXmlUtils.InteropSelectSingleNode(node, pattern)); } XmlNode node1 = xmlNode.SelectSingleNode(pattern); return(node1 != null ? (object)new MsXmlNodeEmulator(node1) : (object)(MsXmlNodeEmulator)null); }
public string GetChildText(object parentElement, string childElementName) { XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(parentElement); if (xmlNode != null) { XmlNode node = xmlNode.SelectSingleNode(childElementName); return(node != null?XmlUtils.GetOwnText(node) : (string)null); } object element = InMetaXmlUtils.InteropSelectSingleNode(parentElement, childElementName); return(element != null?this.GetNodeText(element) : (string)null); }