/// <summary> /// Returns true when the node has the specified value. /// </summary> /// <param name="node">The <see cref="System.Xml.XPath.IXPathNavigable"/></param> /// <param name="setQuery">The query <see cref="System.String"/></param> /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param> /// <param name="testValue">The specified value to test with the node value.</param> /// <param name="nsMan"> /// The <see cref="System.Xml.XmlNamespaceManager"/> /// to use to resolve prefixes. /// </param> /// <param name="comparisonType">The <see cref="System.StringComparison"/> type.</param> public static bool IsNodeValue(IXPathNavigable node, string setQuery, bool throwException, string testValue, XmlNamespaceManager nsMan, StringComparison comparisonType) { string s = (string)XmlUtility.GetNodeValue(node, setQuery, throwException, null, nsMan); return(string.Equals(s, testValue, comparisonType)); }
/// <summary> /// Returns an object for parsing /// and adding to a list of parameters for data access. /// </summary> /// <param name="node">The <see cref="System.Xml.XPath.IXPathNavigable"/></param> /// <param name="setQuery">The <see cref="System.String"/></param> /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param> /// <param name="defaultValue">Return the specified default value for “zero-length” text nodes</param> public static object GetNodeValue(IXPathNavigable node, string setQuery, bool throwException, object defaultValue) { return(XmlUtility.GetNodeValue(node, setQuery, throwException, defaultValue, null)); }
/// <summary> /// Returns true when the node has the specified value. /// </summary> /// <param name="node">The <see cref="System.Xml.XPath.IXPathNavigable"/></param> /// <param name="setQuery">The query <see cref="System.String"/></param> /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param> /// <param name="testValue">The specified value to test with the node value.</param> public static bool IsNodeValue(IXPathNavigable node, string setQuery, bool throwException, string testValue) { string s = (string)XmlUtility.GetNodeValue(node, setQuery, throwException); return(string.Equals(s, testValue, StringComparison.OrdinalIgnoreCase)); }