Exemple #1
0
 public static XPathDocument StripNamespaces(IXPathNavigable navigableSet)
 {
     return(XmlUtility.StripNamespaces(navigableSet, false));
 }
 /// <summary>
 /// Returns a <see cref="System.String"/>
 /// for the transformation of the XSLT file
 /// and the XML file.
 /// </summary>
 /// <param name="xslPath">
 /// outputPath to the XSLT file.
 /// </param>
 /// <param name="xmlPath">
 /// outputPath to the XML file.
 /// </param>
 public static string LoadXslTransform(string xslPath, string xmlPath)
 {
     return(XmlUtility.LoadXslTransform(xslPath, new XsltArgumentList(), xmlPath));
 }
Exemple #3
0
 public static XPathDocument CombineNavigableDocuments(IXPathNavigable parentDocument, IXPathNavigable childDocument)
 {
     return(XmlUtility.CombineNavigableDocuments(parentDocument, childDocument, null));
 }
Exemple #4
0
 /// <summary>
 /// Strip the namespaces from specified <see cref="System.String"/>.
 /// </summary>
 /// <param name="xml">
 /// The source <see cref="System.String"/>.
 /// </param>
 /// <remarks>
 /// WARNING: Stripping namespaces “flattens” the document
 /// and can cause local-name collisions.
 ///
 /// This routine does not remove namespace prefixes.
 ///
 /// </remarks>
 public static string StripNamespaces(string xml)
 {
     return(XmlUtility.StripNamespaces(xml, false));
 }
Exemple #5
0
 /// <summary>
 /// Returns true when the node has the value “yes”.
 /// </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>
 public static bool IsYesNodeValue(IXPathNavigable node, string setQuery, bool throwException)
 {
     return(XmlUtility.IsNodeValue(node, setQuery, throwException, "yes", StringComparison.OrdinalIgnoreCase));
 }
 /// <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"/> to query.</param>
 /// <param name="setQuery">The XPath <see cref="System.String"/>.</param>
 /// <param name="throwException">When <code>true</code>, throw an exception for null nodes and nodes that do not parse into the specified type.</param>
 /// <param name="defaultValue">Return a boxing <see cref="System.Object"/> for “zero-length” text nodes.</param>
 /// <typeparam name="T">The type to parse from the node value.</typeparam>
 public static object GetNodeValueAndParse <T>(IXPathNavigable node, string setQuery, bool throwException, T defaultValue)
 {
     return(XmlUtility.GetNodeValueAndParse <T>(node, setQuery, throwException, defaultValue, null));
 }
Exemple #7
0
        /// <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));
        }
Exemple #8
0
        /// <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));
        }
 /// <summary>
 /// Returns a <see cref="System.String"/>
 /// for the transformation of the XSLT document
 /// and the XML document.
 /// </summary>
 /// <param name="xslSet">
 /// The source <see cref="System.Xml.XPath.IXPathNavigable"/> XSL set.
 /// </param>
 /// <param name="xslArgs">
 /// The <see cref="System.Xml.Xsl.XsltArgumentList"/>.
 /// </param>
 /// <param name="navigableSet">
 /// The source <see cref="System.Xml.XPath.IXPathNavigable"/> XML set.
 /// </param>
 public static string GetXslString(IXPathNavigable xslSet, XsltArgumentList xslArgs, IXPathNavigable navigableSet)
 {
     return(XmlUtility.GetXslString(xslSet, xslArgs, navigableSet, null));
 }
 /// <summary>
 /// Returns a <see cref="System.String"/>
 /// for the transformation of the XSLT document
 /// and the XML document.
 /// </summary>
 /// <param name="xslSet">The source <see cref="System.Xml.XPath.IXPathNavigable"/> XSL set.</param>
 /// <param name="navigableSet">The source <see cref="System.Xml.XPath.IXPathNavigable"/> XML set.</param>
 public static string GetXslString(IXPathNavigable xslSet, IXPathNavigable navigableSet)
 {
     return(XmlUtility.GetXslString(xslSet, null, navigableSet, null));
 }
Exemple #11
0
 public static XPathDocument GetXslResult(IXPathNavigable xslSet, IXPathNavigable navigableSet)
 {
     return(XmlUtility.GetXslResult(xslSet, null, navigableSet));
 }