< Summary - SonghayCore

Information
Class: Songhay.Xml.XmlUtility
Assembly: SonghayCore
File(s): File 1: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.CombineNavigableDocuments.cs
File 2: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInstance.cs
File 3: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInternalMessage.cs
File 4: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInternalMessage.XmlTextWriter.cs
File 5: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInternalMessageDocument.cs
File 6: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNamespaceManager.cs
File 7: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNavigableDocument.cs
File 8: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNavigableNode.cs
File 9: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNodeValue.cs
File 10: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetText.cs
File 11: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetXslResult.cs
File 12: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetXslString.cs
File 13: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.InputAs.cs
File 14: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.IsNodeValue.cs
File 15: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.IsXml.cs
File 16: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.LoadXslTransform.cs
File 17: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.OutputAs.cs
File 18: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.StripNamespaces.cs
File 19: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.StripNamespaces.IXPathNavigable.cs
File 20: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.ValidateNavigableNode.cs
File 21: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.Write.cs
File 22: /home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.XmlDecode.cs
Line coverage
9%
Covered lines: 48
Uncovered lines: 450
Coverable lines: 498
Total lines: 1531
Line coverage: 9.6%
Branch coverage
5%
Covered branches: 11
Total branches: 192
Branch coverage: 5.7%
Method coverage

Method coverage is only available for sponsors.

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
File 1: CombineNavigableDocuments(...)100%10%
File 1: CombineNavigableDocuments(...)0%160%
File 2: GetInstance(...)100%10%
File 2: GetInstanceRaw(...)100%10%
File 3: GetInternalMessage(...)100%10%
File 3: GetInternalMessage(...)100%10%
File 3: GetInternalMessage(...)100%10%
File 3: GetInternalMessage(...)0%60%
File 4: GetInternalMessage(...)100%10%
File 4: GetInternalMessage(...)100%10%
File 4: GetInternalMessage(...)100%10%
File 4: GetInternalMessage(...)0%120%
File 5: GetInternalMessageDocument(...)100%10%
File 5: GetInternalMessageDocument(...)100%10%
File 6: GetNamespaceManager(...)0%80%
File 7: GetNavigableDocument(...)0%20%
File 7: GetNavigableDocument(...)0%40%
File 7: GetNavigableDocument(...)75%4100%
File 8: GetNavigableNode(...)0%60%
File 8: GetNavigableNode(...)0%60%
File 8: GetNavigableNodes(...)0%60%
File 8: GetNavigableNodes(...)0%60%
File 9: GetNodeValue(...)100%10%
File 9: GetNodeValue(...)100%10%
File 9: GetNodeValue(...)0%60%
File 9: GetNodeValueAndParse(...)100%10%
File 9: GetNodeValueAndParse(...)0%420%
File 10: GetText(...)0%40%
File 11: GetXslResult(...)100%10%
File 11: GetXslResult(...)100%10%
File 12: GetXslString(...)100%10%
File 12: GetXslString(...)100%10%
File 12: GetXslString(...)0%20%
File 13: InputAs(...)0%80%
File 14: IsNodeValue(...)100%10%
File 14: IsNodeValue(...)100%10%
File 14: IsNodeValue(...)100%10%
File 14: IsNodeValue(...)100%10%
File 14: IsNoNodeValue(...)100%10%
File 14: IsYesNodeValue(...)100%10%
File 15: IsXml(...)0%40%
File 16: LoadXslTransform(...)100%10%
File 16: LoadXslTransform(...)100%10%
File 16: LoadXslTransform(...)0%20%
File 16: LoadXslTransformForMemoryInput(...)100%10%
File 16: LoadXslTransformForMemoryInput(...)100%10%
File 16: LoadXslTransformForMemoryInput(...)0%20%
File 16: GetXsltArgumentList(...)0%20%
File 17: OutputAs(...)0%20%
File 17: OutputAs(...)0%100%
File 18: StripNamespaces(...)100%10%
File 18: StripNamespaces(...)0%100%
File 19: StripNamespaces(...)100%10%
File 19: StripNamespaces(...)0%40%
File 20: GetXmlSchema(...)0%20%
File 20: LoadXmlSchema(...)0%20%
File 20: ValidateNavigableNode(...)0%20%
File 21: Write(...)100%1100%
File 21: WriteReader(...)0%40%
File 21: WriteXslTransform(...)100%10%
File 21: WriteXslTransform(...)100%10%
File 22: .cctor()100%1100%
File 22: XmlEncode(...)100%4100%
File 22: XmlDecode(...)100%4100%

File(s)

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.CombineNavigableDocuments.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Combines two <see cref="IXPathNavigable"/> documents.
 7    /// </summary>
 8    /// <param name="parentDocument">The <see cref="IXPathNavigable"/> “hosting” document.</param>
 9    /// <param name="childDocument">The <see cref="IXPathNavigable"/> child document.</param>
 10    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 11        Justification = "Specific functionality provided by the concrete type may be required.")]
 12    public static XPathDocument? CombineNavigableDocuments(IXPathNavigable? parentDocument,
 013        IXPathNavigable? childDocument) => CombineNavigableDocuments(parentDocument, childDocument, null);
 14
 15    /// <summary>
 16    /// Combines two <see cref="IXPathNavigable"/> documents.
 17    /// </summary>
 18    /// <param name="parentDocument">The <see cref="IXPathNavigable"/> “hosting” document.</param>
 19    /// <param name="childDocument">The <see cref="IXPathNavigable"/> child document.</param>
 20    /// <param name="nodeQuery">The XPath query to the child document location in the “hosting” document. </param>
 21    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 22        Justification = "Specific functionality provided by the concrete type may be required.")]
 23    public static XPathDocument? CombineNavigableDocuments(IXPathNavigable? parentDocument,
 24        IXPathNavigable? childDocument, string? nodeQuery)
 025    {
 026        if (parentDocument == null || childDocument == null) return null;
 27
 028        var dom = new XmlDocument();
 029        XPathNavigator? domNavigator = dom.CreateNavigator();
 030        if (domNavigator == null) return null;
 31
 032        var navigator = parentDocument.CreateNavigator();
 033        if (navigator == null) return null;
 34
 035        dom.LoadXml(navigator.OuterXml);
 36
 037        if (string.IsNullOrWhiteSpace(nodeQuery))
 038        {
 039            domNavigator.MoveToFirstChild();
 40
 041            XPathNavigator? childNavigator = childDocument.CreateNavigator();
 042            if (childNavigator != null) domNavigator.AppendChild(childNavigator.OuterXml);
 043            domNavigator.MoveToRoot();
 044        }
 45        else
 046        {
 047            XPathNodeIterator nodes = domNavigator.Select(nodeQuery);
 048            foreach (XPathNavigator n in nodes)
 049            {
 050                XPathNavigator? childNavigator = childDocument.CreateNavigator();
 051                if (childNavigator != null) n.AppendChild(childNavigator.OuterXml);
 052                break;
 53            }
 054        }
 55
 056        using var reader = new StringReader(domNavigator.OuterXml);
 057        var combinedDocument = new XPathDocument(reader);
 58
 059        return combinedDocument;
 060    }
 61}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInstance.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Deserializes based on the specified XML file.
 7    /// </summary>
 8    /// <typeparam name="T">
 9    /// The specified type to deserialize.
 10    /// </typeparam>
 11    /// <param name="xmlPath">The XML file path.</param>
 12    public static T? GetInstance<T>(string? xmlPath) where T : class
 013    {
 014        var serializer = new XmlSerializer(typeof(T));
 15
 016        using XmlReader reader = XmlReader.Create(xmlPath!);
 017        T? instance = serializer.Deserialize(reader) as T;
 18
 019        return instance;
 020    }
 21
 22    /// <summary>
 23    /// Deserializes based on the specified raw XML.
 24    /// </summary>
 25    /// <typeparam name="T">
 26    /// The specified type to deserialize.
 27    /// </typeparam>
 28    /// <param name="xmlFragment">The raw XML.</param>
 29    public static T? GetInstanceRaw<T>(string? xmlFragment) where T : class
 030    {
 031        xmlFragment.ThrowWhenNullOrWhiteSpace();
 32
 033        var serializer = new XmlSerializer(typeof(T));
 34
 035        using var reader = new StringReader(xmlFragment);
 036        var instance = serializer.Deserialize(reader) as T;
 37
 038        return instance;
 039    }
 40}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInternalMessage.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns an XML <see cref="string"/>
 7    /// based on the specified header and lines.
 8    /// </summary>
 9    /// <param name="messageHeader">Message header.</param>
 10    public static string GetInternalMessage(string messageHeader) =>
 011        GetInternalMessage(messageHeader, string.Empty, null);
 12
 13    /// <summary>
 14    /// Returns an XML <see cref="string"/>
 15    /// based on the specified header and lines.
 16    /// </summary>
 17    /// <param name="messageHeader">Message header.</param>
 18    /// <param name="messageLines">Message lines.</param>
 19    public static string GetInternalMessage(string messageHeader, string[] messageLines) =>
 020        GetInternalMessage(messageHeader, string.Empty, messageLines);
 21
 22    /// <summary>
 23    /// Returns an XML <see cref="string"/>
 24    /// based on the specified header and lines.
 25    /// </summary>
 26    /// <param name="messageHeader">Message header.</param>
 27    /// <param name="messageLines">Message lines.</param>
 28    public static string GetInternalMessage(string messageHeader, ReadOnlyCollection<string>? messageLines) =>
 029        GetInternalMessage(messageHeader, string.Empty, messageLines);
 30
 31    /// <summary>
 32    /// Returns an XML <see cref="string"/>
 33    /// based on the specified header and lines.
 34    /// </summary>
 35    /// <param name="messageHeader">Message header.</param>
 36    /// <param name="messageCode">Message code for errors, exceptions or faults.</param>
 37    /// <param name="messageLines">Message lines.</param>
 38    public static string GetInternalMessage(string? messageHeader, string? messageCode,
 39        IEnumerable<string>? messageLines)
 040    {
 041        var sb = new StringBuilder();
 042        sb.AppendLine("<InternalMessage>");
 43
 044        sb.AppendLine(CultureInfo.InvariantCulture, $"<Header>{messageHeader}</Header>");
 045        if (!string.IsNullOrWhiteSpace(messageCode))
 046            sb.AppendLine(CultureInfo.InvariantCulture, $"<Code>{messageCode}</Code>");
 47
 048        if (messageLines is not null)
 049        {
 050            foreach (string line in messageLines)
 051            {
 052                sb.AppendLine(CultureInfo.InvariantCulture, $"<Line>{line}</Line>");
 053            }
 054        }
 55
 056        sb.AppendLine("</InternalMessage>");
 57
 058        return sb.ToString();
 059    }
 60}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInternalMessage.XmlTextWriter.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Gets the conventional, XML <c>&lt;InternalMessage&gt;</c>.
 7    /// </summary>
 8    /// <param name="messageHeader">Message header.</param>
 9    /// <param name="messageLines">Message lines.</param>
 10    /// <param name="xmlDataWriter">The <see cref="XmlWriter"/>.</param>
 11    public static void GetInternalMessage(string? messageHeader, string[]? messageLines, XmlWriter? xmlDataWriter) =>
 012        GetInternalMessage(messageHeader, string.Empty, messageLines, xmlDataWriter, false);
 13
 14    /// <summary>
 15    /// Gets the conventional, XML <c>&lt;InternalMessage&gt;</c>.
 16    /// </summary>
 17    /// <param name="messageHeader">Message header.</param>
 18    /// <param name="messageCode">Message code for errors, exceptions or faults.</param>
 19    /// <param name="messageLines">Message lines.</param>
 20    /// <param name="xmlDataWriter">The <see cref="XmlTextWriter"/>.</param>
 21    public static void GetInternalMessage(string? messageHeader, string? messageCode, string[]? messageLines,
 022        XmlWriter xmlDataWriter) => GetInternalMessage(messageHeader, messageCode, messageLines, xmlDataWriter, false);
 23
 24    /// <summary>
 25    /// Gets the conventional, XML <c>&lt;InternalMessage&gt;</c>.
 26    /// </summary>
 27    /// <param name="messageHeader">Message header.</param>
 28    /// <param name="messageLines">Message lines.</param>
 29    /// <param name="xmlDataWriter">The <see cref="XmlWriter"/>.</param>
 30    /// <param name="isFragment">When <c>false</c> a new document is started.</param>
 31    public static void GetInternalMessage(string? messageHeader, string[]? messageLines, XmlWriter? xmlDataWriter,
 032        bool isFragment) => GetInternalMessage(messageHeader, string.Empty, messageLines, xmlDataWriter, isFragment);
 33
 34    /// <summary>
 35    /// Gets the conventional, XML <c>&lt;InternalMessage&gt;</c>.
 36    /// </summary>
 37    /// <param name="messageHeader">Message header.</param>
 38    /// <param name="messageCode">Message code for errors, exceptions or faults.</param>
 39    /// <param name="messageLines">Message lines.</param>
 40    /// <param name="xmlDataWriter">The <see cref="XmlWriter"/>.</param>
 41    /// <param name="isFragment">When <c>false</c> a new document is started.</param>
 42    public static void GetInternalMessage(string? messageHeader, string? messageCode, string[]? messageLines,
 43        XmlWriter? xmlDataWriter, bool isFragment)
 044    {
 045        ArgumentNullException.ThrowIfNull(xmlDataWriter);
 46
 047        if (!isFragment) xmlDataWriter.WriteStartDocument();
 048        xmlDataWriter.WriteStartElement("InternalMessage");
 49
 050        xmlDataWriter.WriteElementString("Header", messageHeader);
 051        if (!string.IsNullOrWhiteSpace(messageCode)) xmlDataWriter.WriteElementString("Code", messageCode);
 52
 053        if (messageLines is {Length: > 0})
 054        {
 055            foreach (string line in messageLines)
 056            {
 057                xmlDataWriter.WriteElementString("Line", line);
 058            }
 059        }
 60
 061        xmlDataWriter.WriteFullEndElement();
 062        if (!isFragment) xmlDataWriter.WriteEndDocument();
 063    }
 64}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetInternalMessageDocument.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns an <see cref="XPathDocument"/>
 7    /// based on the specified header and lines.
 8    /// </summary>
 9    /// <param name="messageHeader">Message header.</param>
 10    /// <param name="messageLines">Message lines.</param>
 11    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 12        Justification = "Specific functionality provided by the concrete type may be required.")]
 13    public static XPathDocument? GetInternalMessageDocument(string? messageHeader, string[]? messageLines) =>
 014        GetInternalMessageDocument(messageHeader, string.Empty, messageLines);
 15
 16
 17    /// <summary>
 18    /// Returns an <see cref="XPathDocument"/>
 19    /// based on the specified header and lines.
 20    /// </summary>
 21    /// <param name="messageHeader">Message header.</param>
 22    /// <param name="messageCode">Message code for errors, exceptions or faults</param>
 23    /// <param name="messageLines">Message lines.</param>
 24    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 25        Justification = "Specific functionality provided by the concrete type may be required.")]
 26    public static XPathDocument? GetInternalMessageDocument(string? messageHeader, string? messageCode,
 27        string[]? messageLines)
 028    {
 029        string s = GetInternalMessage(messageHeader, messageCode, messageLines);
 30
 031        return GetNavigableDocument(s);
 032    }
 33}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNamespaceManager.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns a <see cref="XmlNamespaceManager"/>
 7    /// with respect to the document element of the specified
 8    /// <see cref="IXPathNavigable"/> document.
 9    /// </summary>
 10    /// <param name="navigable">
 11    /// The <see cref="IXPathNavigable"/> document.
 12    /// </param>
 13    public static XmlNamespaceManager? GetNamespaceManager(IXPathNavigable? navigable)
 014    {
 015        XmlNamespaceManager? nsman = null;
 016        if (navigable == null) return nsman;
 17
 018        XPathNavigator? navigator = navigable.CreateNavigator();
 019        XPathExpression xpath = XPathExpression.Compile("//*[1]");
 020        var root = navigator?.SelectSingleNode(xpath);
 21
 022        if (root == null) throw new NullReferenceException("The expected XPath Navigator is not here.");
 23
 024        nsman = new XmlNamespaceManager(root.NameTable);
 25
 026        IDictionary<string, string> names = root.GetNamespacesInScope(XmlNamespaceScope.Local);
 027        foreach (KeyValuePair<string, string> kv in names)
 028        {
 029            nsman.AddNamespace(kv.Key, kv.Value);
 030        }
 31
 032        return nsman;
 033    }
 34}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNavigableDocument.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns an <see cref="XPathDocument"/>
 7    /// based on the specified <see cref="string"/>.
 8    /// </summary>
 9    /// <param name="xmlFragment">
 10    /// A well-formed XML <see cref="string"/>.
 11    /// </param>
 12    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 13        Justification = "Specific functionality provided by the concrete type may be required.")]
 14    public static XPathDocument? GetNavigableDocument(string? xmlFragment)
 015    {
 016        if (string.IsNullOrWhiteSpace(xmlFragment)) return null;
 17
 018        using StringReader reader = new StringReader(xmlFragment);
 019        var d = new XPathDocument(reader);
 20
 021        return d;
 022    }
 23
 24    /// <summary>
 25    /// Returns an <see cref="XPathDocument"/>
 26    /// based on the specified <see cref="XmlNode"/>.
 27    /// </summary>
 28    /// <param name="navigable">
 29    /// The source <see cref="IXPathNavigable"/> document.
 30    /// </param>
 31    /// <remarks>
 32    /// Use this member to convert <see cref="XmlDocument"/> documents.
 33    /// </remarks>
 34    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 35        Justification = "Specific functionality provided by the concrete type may be required.")]
 36    public static XPathDocument? GetNavigableDocument(IXPathNavigable? navigable)
 037    {
 038        var navigator = navigable?.CreateNavigator();
 039        if (navigator == null) return null;
 40
 041        using StringReader reader = new StringReader(navigator.OuterXml);
 042        var d = new XPathDocument(reader);
 43
 044        return d;
 045    }
 46
 47    /// <summary>
 48    /// Returns an <see cref="XPathDocument"/>
 49    /// based on the specified <see cref="Stream"/>.
 50    /// </summary>
 51    /// <param name="stream">The stream.</param>
 52    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 53        Justification = "Specific functionality provided by the concrete type may be required.")]
 54    public static XPathDocument? GetNavigableDocument(Stream? stream)
 155    {
 156        if (stream == null) return null;
 257        if (stream.Position != 0) stream.Position = 0;
 58
 159        XPathDocument d = new XPathDocument(stream);
 60
 161        return d;
 162    }
 63}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNavigableNode.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns an <see cref="XPathNavigator"/>
 7    /// based on the nodeQuery Expression toward the source document.
 8    /// </summary>
 9    /// <param name="navigable">
 10    /// The source <see cref="IXPathNavigable"/> document.
 11    /// </param>
 12    /// <param name="nodeQuery">
 13    /// The value to be compiled
 14    /// into an <see cref="XPathExpression"/>.
 15    /// </param>
 16    public static XPathNavigator? GetNavigableNode(IXPathNavigable? navigable, string? nodeQuery)
 017    {
 018        if (navigable == null) return null;
 019        if (string.IsNullOrWhiteSpace(nodeQuery)) return null;
 20
 021        XPathNavigator? navigator = navigable.CreateNavigator();
 022        XPathExpression xpath = XPathExpression.Compile(nodeQuery);
 023        var node = navigator?.SelectSingleNode(xpath);
 24
 025        return node;
 026    }
 27
 28    /// <summary>
 29    /// Returns an <see cref="XPathNavigator"/>
 30    /// based on the nodeQuery Expression toward the source document.
 31    /// </summary>
 32    /// <param name="navigable">
 33    /// The source <see cref="IXPathNavigable"/> document.
 34    /// </param>
 35    /// <param name="nodeQuery">
 36    /// The value to be compiled
 37    /// into an <see cref="XPathExpression"/>.
 38    /// </param>
 39    /// <param name="nsMan">
 40    /// The <see cref="XmlNamespaceManager"/>
 41    /// to use to resolve prefixes.
 42    /// </param>
 43    public static XPathNavigator? GetNavigableNode(IXPathNavigable? navigable, string? nodeQuery,
 44        XmlNamespaceManager? nsMan)
 045    {
 046        if (navigable == null) return null;
 047        if (string.IsNullOrWhiteSpace(nodeQuery)) return null;
 48
 049        XPathNavigator? navigator = navigable.CreateNavigator();
 050        XPathExpression xpath = XPathExpression.Compile(nodeQuery, nsMan);
 051        var node = navigator?.SelectSingleNode(xpath);
 52
 053        return node;
 054    }
 55
 56    /// <summary>
 57    /// Returns an <see cref="XPathNodeIterator"/>
 58    /// based on the nodeQuery Expression toward the source document.
 59    /// </summary>
 60    /// <param name="navigable">
 61    /// The source <see cref="IXPathNavigable"/> document.
 62    /// </param>
 63    /// <param name="nodeQuery">
 64    /// The value to be compiled
 65    /// into an <see cref="XPathExpression"/>.
 66    /// </param>
 67    public static XPathNodeIterator? GetNavigableNodes(IXPathNavigable? navigable, string? nodeQuery)
 068    {
 069        if (navigable == null) return null;
 070        if (string.IsNullOrWhiteSpace(nodeQuery)) return null;
 71
 072        XPathNavigator? navigator = navigable.CreateNavigator();
 73
 074        XPathExpression xpath = XPathExpression.Compile(nodeQuery);
 075        var nodes = navigator?.Select(xpath);
 76
 077        return nodes;
 078    }
 79
 80    /// <summary>
 81    /// Returns an <see cref="XPathNodeIterator"/>
 82    /// based on the nodeQuery Expression toward the source document.
 83    /// </summary>
 84    /// <param name="navigable">
 85    /// The source <see cref="IXPathNavigable"/> document.
 86    /// </param>
 87    /// <param name="nodeQuery">
 88    /// The value to be compiled
 89    /// into an <see cref="XPathExpression"/>.
 90    /// </param>
 91    /// <param name="nsMan">
 92    /// The <see cref="XmlNamespaceManager"/>
 93    /// to use to resolve prefixes.
 94    /// </param>
 95    public static XPathNodeIterator? GetNavigableNodes(IXPathNavigable? navigable, string? nodeQuery,
 96        XmlNamespaceManager nsMan)
 097    {
 098        if (navigable == null) return null;
 099        if (string.IsNullOrWhiteSpace(nodeQuery)) return null;
 100
 0101        XPathNavigator? navigator = navigable.CreateNavigator();
 102
 0103        XPathExpression xpath = XPathExpression.Compile(nodeQuery, nsMan);
 0104        var nodes = navigator?.Select(xpath);
 105
 0106        return nodes;
 0107    }
 108}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetNodeValue.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns an object for parsing
 7    /// and adding to a list of parameters for data access.
 8    /// </summary>
 9    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 10    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 11    /// <param name="throwException">When <c>true</c>, throw an exception for null nodes.</param>
 12    public static object? GetNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException) =>
 013        GetNodeValue(node, nodeQuery, throwException, null);
 14
 15    /// <summary>
 16    /// Returns an object for parsing
 17    /// and adding to a list of parameters for data access.
 18    /// </summary>
 19    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 20    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 21    /// <param name="throwException">When <c>true</c>, throw an exception for null nodes.</param>
 22    /// <param name="defaultValue">Return the specified default value for “zero-length” text nodes.</param>
 23    public static object? GetNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException,
 024        object? defaultValue) => GetNodeValue(node, nodeQuery, throwException, defaultValue, null);
 25
 26    /// <summary>
 27    /// Returns an object for parsing
 28    /// and adding to a list of parameters for data access.
 29    /// </summary>
 30    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 31    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 32    /// <param name="throwException">When <c>true</c>, throw an exception for null nodes.</param>
 33    /// <param name="defaultValue">Return the specified default value for “zero-length” text nodes.</param>
 34    /// <param name="nsMan">
 35    /// The <see cref="XmlNamespaceManager"/>
 36    /// to use to resolve prefixes.
 37    /// </param>
 38    public static object? GetNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException,
 39        object? defaultValue,
 40        XmlNamespaceManager? nsMan)
 041    {
 042        XPathNavigator? n = GetNavigableNode(node, nodeQuery, nsMan);
 043        object? p = defaultValue;
 44
 045        if (n != null)
 046        {
 047            if (n.Value.Trim().Length > 0) p = n.Value.Trim();
 048        }
 049        else if (throwException)
 050        {
 051            throw new XmlException($"Element at “{nodeQuery}” was not found.");
 52        }
 53
 054        return p;
 055    }
 56
 57    /// <summary>
 58    /// Returns an object for parsing
 59    /// and adding to a list of parameters for data access.
 60    /// </summary>
 61    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 62    /// <param name="nodeQuery">The XPath <see cref="string"/>.</param>
 63    /// <param name="throwException">When <c>true</c>, throw an exception for null nodes and nodes that do not parse int
 64    /// <param name="defaultValue">Return a boxing <see cref="Object"/> for “zero-length” text nodes.</param>
 65    /// <typeparam name="T">The type to parse from the node value.</typeparam>
 66    public static object? GetNodeValueAndParse<T>(IXPathNavigable? node, string? nodeQuery, bool throwException,
 067        T defaultValue) => GetNodeValueAndParse(node, nodeQuery, throwException, defaultValue, null);
 68
 69    /// <summary>
 70    /// Returns an object for parsing
 71    /// and adding to a list of parameters for data access.
 72    /// </summary>
 73    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 74    /// <param name="nodeQuery">The XPath <see cref="string"/>.</param>
 75    /// <param name="throwException">When <c>true</c>, throw an exception for null nodes and nodes that do not parse int
 76    /// <param name="defaultValue">Return a boxing <see cref="Object"/> for “zero-length” text nodes.</param>
 77    /// <param name="nsMan">
 78    /// The <see cref="XmlNamespaceManager"/>
 79    /// to use to resolve prefixes.
 80    /// </param>
 81    /// <typeparam name="T">The type to parse from the node value.</typeparam>
 82    public static object? GetNodeValueAndParse<T>(IXPathNavigable? node, string? nodeQuery, bool throwException,
 83        T? defaultValue, XmlNamespaceManager? nsMan)
 084    {
 085        object? p = GetNodeValue(node, nodeQuery, throwException, nsMan);
 86
 87        try
 088        {
 089            T? stronglyOfT = default(T);
 90
 091            if (p == null || string.IsNullOrWhiteSpace(p.ToString()?.Trim()))
 092            {
 093                p = defaultValue;
 094            }
 95            else
 096                switch (stronglyOfT)
 97                {
 98                    case bool:
 099                        p = bool.Parse(p.ToString() ?? string.Empty);
 0100                        break;
 101                    case byte:
 0102                        p = Byte.Parse(p.ToString() ?? string.Empty, CultureInfo.CurrentCulture);
 0103                        break;
 104                    case DateTime:
 0105                        p = DateTime.Parse(p.ToString() ?? string.Empty, CultureInfo.CurrentCulture);
 0106                        break;
 107                    case decimal:
 0108                        p = Decimal.Parse(p.ToString() ?? string.Empty, CultureInfo.CurrentCulture);
 0109                        break;
 110                    case double:
 0111                        p = Double.Parse(p.ToString() ?? string.Empty, CultureInfo.CurrentCulture);
 0112                        break;
 113                    case short:
 0114                        p = Int16.Parse(p.ToString() ?? string.Empty, CultureInfo.CurrentCulture);
 0115                        break;
 116                    case int:
 0117                        p = Int32.Parse(p.ToString() ?? string.Empty, CultureInfo.CurrentCulture);
 0118                        break;
 119                    case long:
 0120                        p = Int64.Parse(p.ToString() ?? string.Empty, CultureInfo.CurrentCulture);
 0121                        break;
 122                    default:
 0123                    {
 0124                        if (typeof(T).IsAssignableFrom(typeof(string)))
 0125                        {
 0126                            p = p.ToString();
 0127                        }
 128                        else
 0129                        {
 0130                            Type t = typeof(T);
 0131                            throw new ArgumentException(string.Format(CultureInfo.CurrentCulture,
 0132                                "The specified type, “{0},” is not supported.", t.FullName));
 133                        }
 134
 0135                        break;
 136                    }
 137                }
 0138        }
 0139        catch (Exception ex)
 0140        {
 0141            Type t = typeof(T);
 0142            var errMsg =
 0143                $"Parse for “{t.FullName}” fails for element in “{nodeQuery}.” Value to parse: “{((p == null) ? "Null" :
 0144            throw new XmlException(errMsg);
 145        }
 146
 0147        return p;
 0148    }
 149}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetText.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// “Cleans” XML data returning
 7    /// in a <see cref="MemoryStream"/>.
 8    /// </summary>
 9    /// <param name="ramStream"><see cref="MemoryStream"/></param>
 10    public static string? GetText(MemoryStream? ramStream)
 011    {
 012        if (ramStream == null) return null;
 13
 014        var s = Encoding.UTF8.GetString(ramStream.ToArray());
 15
 016        if (!string.IsNullOrWhiteSpace(s))
 017            s = s.Trim().Replace("\0", string.Empty);
 18
 019        return s;
 020    }
 21}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetXslResult.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns a <see cref="XPathDocument"/>
 7    /// for the transformation of the XSLT document
 8    /// and the XML document.
 9    /// </summary>
 10    /// <param name="navigableXsl">
 11    /// The source <see cref="IXPathNavigable"/> XSL document.
 12    /// </param>
 13    /// <param name="navigableSet">
 14    /// The source <see cref="IXPathNavigable"/> XML document.
 15    /// </param>
 16    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 17        Justification = "Specific functionality provided by the concrete type may be required.")]
 18    public static XPathDocument GetXslResult(IXPathNavigable? navigableXsl, IXPathNavigable? navigableSet) =>
 019        GetXslResult(navigableXsl, null, navigableSet);
 20
 21    /// <summary>
 22    /// Returns a <see cref="XPathDocument"/>
 23    /// for the transformation of the XSLT document
 24    /// and the XML document.
 25    /// </summary>
 26    /// <param name="navigableXsl">
 27    /// The source <see cref="IXPathNavigable"/> XSL document.
 28    /// </param>
 29    /// <param name="xslArgs">
 30    /// The <see cref="XsltArgumentList"/>.
 31    /// </param>
 32    /// <param name="navigableXml">
 33    /// The source <see cref="IXPathNavigable"/> XML document.
 34    /// </param>
 35    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 36        Justification = "Specific functionality provided by the concrete type may be required.")]
 37    public static XPathDocument GetXslResult(IXPathNavigable? navigableXsl, XsltArgumentList? xslArgs,
 38        IXPathNavigable? navigableXml)
 039    {
 040        ArgumentNullException.ThrowIfNull(navigableXsl);
 041        ArgumentNullException.ThrowIfNull(navigableXml);
 42
 043        XslCompiledTransform xslt = new XslCompiledTransform(false);
 044        xslt.Load(navigableXsl);
 45
 046        var navigator = navigableXml.CreateNavigator().ToReferenceTypeValueOrThrow();
 47
 048        using MemoryStream ms = new MemoryStream();
 049        using (StringReader sr = new StringReader(navigator.OuterXml))
 050        {
 051            XmlReader reader = XmlReader.Create(sr);
 052            XmlWriter writer = XmlWriter.Create(ms);
 053            xslt.Transform(reader, xslArgs, writer, null);
 54            //FUNKYKB: Setting documentResolver to null prevents namespace URI calls (document() resolution).
 055        }
 56
 057        ms.Position = 0;
 058        var ret = new XPathDocument(ms);
 59
 060        return ret;
 061    }
 62}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.GetXslString.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns a <see cref="string"/>
 7    /// for the transformation of the XSLT document
 8    /// and the XML document.
 9    /// </summary>
 10    /// <param name="navigableXsl">The source <see cref="IXPathNavigable"/> XSL document.</param>
 11    /// <param name="navigableSet">The source <see cref="IXPathNavigable"/> XML document.</param>
 12    public static string? GetXslString(IXPathNavigable? navigableXsl, IXPathNavigable? navigableSet) =>
 013        GetXslString(navigableXsl, null, navigableSet, null);
 14
 15    /// <summary>
 16    /// Returns a <see cref="string"/>
 17    /// for the transformation of the XSLT document
 18    /// and the XML document.
 19    /// </summary>
 20    /// <param name="navigableXsl">
 21    /// The source <see cref="IXPathNavigable"/> XSL document.
 22    /// </param>
 23    /// <param name="xslArgs">
 24    /// The <see cref="XsltArgumentList"/>.
 25    /// </param>
 26    /// <param name="navigableXml">
 27    /// The source <see cref="IXPathNavigable"/> XML document.
 28    /// </param>
 29    public static string?
 30        GetXslString(IXPathNavigable? navigableXsl, XsltArgumentList? xslArgs, IXPathNavigable? navigableXml) =>
 031        GetXslString(navigableXsl, xslArgs, navigableXml, null);
 32
 33    /// <summary>
 34    /// Returns a <see cref="string"/>
 35    /// for the transformation of the XSLT document
 36    /// and the XML document.
 37    /// </summary>
 38    /// <param name="navigableXsl">The source <see cref="IXPathNavigable"/> XSL document.</param>
 39    /// <param name="xslArgs">The <see cref="XsltArgumentList"/>.</param>
 40    /// <param name="navigableXml">The source <see cref="IXPathNavigable"/> XML document.</param>
 41    /// <param name="settings">The settings.</param>
 42    public static string? GetXslString(IXPathNavigable? navigableXsl, XsltArgumentList? xslArgs,
 43        IXPathNavigable? navigableXml,
 44        XmlWriterSettings? settings)
 045    {
 046        ArgumentNullException.ThrowIfNull(navigableXsl);
 047        ArgumentNullException.ThrowIfNull(navigableXml);
 48
 049        var navigator = navigableXml.CreateNavigator().ToReferenceTypeValueOrThrow();
 050        XslCompiledTransform xslt = new XslCompiledTransform(false);
 051        xslt.Load(navigableXsl);
 52
 053        using MemoryStream ms = new MemoryStream();
 054        using (StringReader sr = new StringReader(navigator.OuterXml))
 055        {
 056            XmlReader reader = XmlReader.Create(sr);
 057            XmlWriter writer = (settings != null) ? XmlWriter.Create(ms, settings) : XmlWriter.Create(ms);
 058            xslt.Transform(reader, xslArgs, writer, null);
 059        }
 60
 061        ms.Position = 0;
 62
 063        var ret = GetText(ms);
 64
 065        return ret;
 066    }
 67}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.InputAs.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns an <see cref="XPathDocument"/>,
 7    /// converted from the specified input.
 8    /// </summary>
 9    /// <typeparam name="TIn">The <see cref="Type"/> of the input.</typeparam>
 10    /// <param name="input">The input.</param>
 11    /// <returns>Returns an <see cref="XPathDocument"/>.</returns>
 12    /// <remarks>
 13    /// This member only supports <c>TIn</c> as
 14    /// <see cref="string"/>, <see cref="XmlDocument"/> or <see cref="XPathDocument"/>.
 15    /// </remarks>
 16    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 17        Justification = "Specific functionality provided by the concrete type may be required.")]
 18    public static XPathDocument? InputAs<TIn>(TIn? input) where TIn: class
 019    {
 020        if (input == null) return null;
 21
 022        TIn? stronglyOfTIn = default(TIn);
 023        switch (stronglyOfTIn)
 24        {
 25            case XmlDocument:
 026                return GetNavigableDocument(input as XmlDocument);
 27            case XPathDocument:
 028                return input as XPathDocument;
 29            default:
 030                if (!typeof(TIn).IsAssignableFrom(typeof(string))) return null;
 31
 032                string? s = input as string;
 033                s = HtmlUtility.ConvertToXml(s);
 034                s = LatinGlyphsUtility.Condense(s, basicLatinOnly: false);
 35
 036                return GetNavigableDocument(s);
 37        }
 038    }
 39}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.IsNodeValue.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns true when the node has the specified value.
 7    /// </summary>
 8    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 9    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 10    /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param>
 11    /// <param name="testValue">The specified value to test with the node value.</param>
 12    public static bool IsNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException, string? testValue)
 013    {
 014        string? s = GetNodeValue(node, nodeQuery, throwException) as string;
 15
 016        return string.Equals(s, testValue, StringComparison.OrdinalIgnoreCase);
 017    }
 18
 19    /// <summary>
 20    /// Returns true when the node has the specified value.
 21    /// </summary>
 22    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 23    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 24    /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param>
 25    /// <param name="testValue">The specified value to test with the node value.</param>
 26    /// <param name="comparisonType">The <see cref="StringComparison"/> type.</param>
 27    public static bool IsNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException, string? testValue,
 28        StringComparison comparisonType)
 029    {
 030        string? s = GetNodeValue(node, nodeQuery, throwException) as string;
 31
 032        return string.Equals(s, testValue, comparisonType);
 033    }
 34
 35    /// <summary>
 36    /// Returns true when the node has the specified value.
 37    /// </summary>
 38    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 39    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 40    /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param>
 41    /// <param name="testValue">The specified value to test with the node value.</param>
 42    /// <param name="nsMan">
 43    /// The <see cref="XmlNamespaceManager"/>
 44    /// to use to resolve prefixes.
 45    /// </param>
 46    public static bool IsNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException, string? testValue,
 47        XmlNamespaceManager nsMan)
 048    {
 049        string? s = GetNodeValue(node, nodeQuery, throwException, null, nsMan) as string;
 50
 051        return string.Equals(s, testValue);
 052    }
 53
 54    /// <summary>
 55    /// Returns true when the node has the specified value.
 56    /// </summary>
 57    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 58    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 59    /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param>
 60    /// <param name="testValue">The specified value to test with the node value.</param>
 61    /// <param name="nsMan">
 62    /// The <see cref="XmlNamespaceManager"/>
 63    /// to use to resolve prefixes.
 64    /// </param>
 65    /// <param name="comparisonType">The <see cref="StringComparison"/> type.</param>
 66    public static bool IsNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException, string? testValue,
 67        XmlNamespaceManager nsMan, StringComparison comparisonType)
 068    {
 069        string? s = GetNodeValue(node, nodeQuery, throwException, null, nsMan) as string;
 70
 071        return string.Equals(s, testValue, comparisonType);
 072    }
 73
 74    /// <summary>
 75    /// Returns true when the node has the value “no”.
 76    /// </summary>
 77    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 78    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 79    /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param>
 80    public static bool IsNoNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException) =>
 081        IsNodeValue(node, nodeQuery, throwException, "no", StringComparison.OrdinalIgnoreCase);
 82
 83    /// <summary>
 84    /// Returns true when the node has the value “yes”.
 85    /// </summary>
 86    /// <param name="node">The <see cref="IXPathNavigable"/> node.</param>
 87    /// <param name="nodeQuery">The node query <see cref="string"/>.</param>
 88    /// <param name="throwException">When <code>true</code>, throw an exception for null nodes.</param>
 89    public static bool IsYesNodeValue(IXPathNavigable? node, string? nodeQuery, bool throwException) =>
 090        IsNodeValue(node, nodeQuery, throwException, "yes", StringComparison.OrdinalIgnoreCase);
 91}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.IsXml.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns <c>true</c> when the fragment is XML-like.
 7    /// </summary>
 8    /// <param name="fragment">The fragment to test.</param>
 9    public static bool IsXml(string? fragment)
 010    {
 011        if (string.IsNullOrWhiteSpace(fragment)) return false;
 12
 013        Match xmlMatch = Regex.Match(fragment, @"<([^>]+)>(.*?</(\1)>|[^>]*/>)");
 014        Match xmlMatchMinimized = Regex.Match(fragment, @"<([^>]+)/>");
 15
 016        return xmlMatch.Success || xmlMatchMinimized.Success;
 017    }
 18}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.LoadXslTransform.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns a <see cref="string"/>
 7    /// for the transformation of the XSLT file
 8    /// and the XML file.
 9    /// </summary>
 10    /// <param name="xslPath">
 11    /// Output path to the XSLT file.
 12    /// </param>
 13    /// <param name="xmlPath">
 14    /// Output path to the XML file.
 15    /// </param>
 16    public static string? LoadXslTransform(string? xslPath, string? xmlPath) =>
 017        LoadXslTransform(xslPath, xslArgs: null, xmlPath);
 18
 19    /// <summary>
 20    /// Returns a <see cref="string"/>
 21    /// for the transformation of the XSLT file
 22    /// and the XML file.
 23    /// </summary>
 24    /// <param name="xslPath">
 25    /// Output path to the XSLT file.
 26    /// </param>
 27    /// <param name="commandName">
 28    /// The value for the <code>cmd</code>-parameter convention.
 29    /// </param>
 30    /// <param name="xmlPath">
 31    /// Output path to the XML file.
 32    /// </param>
 33    public static string? LoadXslTransform(string? xslPath, string? commandName, string? xmlPath)
 034    {
 035        var xslArgs = GetXsltArgumentList(commandName);
 36
 037        return LoadXslTransform(xslPath, xslArgs, xmlPath);
 038    }
 39
 40    /// <summary>
 41    /// Returns a <see cref="string"/>
 42    /// for the transformation of the XSLT file
 43    /// and the XML file.
 44    /// </summary>
 45    /// <param name="xslPath">
 46    /// Output path to the XSLT file.
 47    /// </param>
 48    /// <param name="xslArgs">
 49    /// The <see cref="XsltArgumentList"/>.
 50    /// </param>
 51    /// <param name="xmlPath">
 52    /// Output path to the XML file.
 53    /// </param>
 54    public static string? LoadXslTransform(string? xslPath, XsltArgumentList? xslArgs, string? xmlPath)
 055    {
 056        xslPath.ThrowWhenNullOrWhiteSpace();
 057        xmlPath.ThrowWhenNullOrWhiteSpace();
 58
 059        xslArgs ??= new XsltArgumentList();
 60
 061        XslCompiledTransform xslt = new XslCompiledTransform(false);
 062        xslt.Load(xslPath);
 63
 064        using MemoryStream ms = new MemoryStream();
 065        using (XmlReader reader = XmlReader.Create(xmlPath))
 066        {
 067            XmlWriter writer = XmlWriter.Create(ms);
 068            xslt.Transform(reader, xslArgs, writer, null);
 069        }
 70
 071        var ret = GetText(ms);
 72
 073        return ret;
 074    }
 75
 76    /// <summary>
 77    /// Returns a <see cref="string"/>
 78    /// for the transformation of the XSLT file
 79    /// and the specified <see cref="IXPathNavigable"/> in memory.
 80    /// </summary>
 81    /// <param name="xslPath">
 82    /// Output path to the XSLT file.
 83    /// </param>
 84    /// <param name="commandName">
 85    /// The value for the <code>cmd</code>-parameter convention.
 86    /// </param>
 87    /// <param name="xmlFragment">
 88    /// A well-formed XML <see cref="string"/>.
 89    /// </param>
 90    /// <remarks>
 91    /// This convention is used in ASP.NET Web applications.
 92    /// </remarks>
 93    public static string? LoadXslTransformForMemoryInput(string? xslPath, string? commandName,
 94        string? xmlFragment)
 095    {
 096        var xslArgs = GetXsltArgumentList(commandName);
 97
 098        return LoadXslTransformForMemoryInput(xslPath, xslArgs, xmlFragment);
 099    }
 100
 101    /// <summary>
 102    /// Returns a <see cref="string"/>
 103    /// for the transformation of the XSLT file
 104    /// and the specified <see cref="IXPathNavigable"/> in memory.
 105    /// </summary>
 106    /// <param name="xslPath">
 107    /// Output path to the XSLT file.
 108    /// </param>
 109    /// <param name="commandName">
 110    /// The value for the <code>cmd</code>-parameter convention.
 111    /// </param>
 112    /// <param name="navigableXml">
 113    /// The <see cref="IXPathNavigable"/> in memory.
 114    /// </param>
 115    /// <remarks>
 116    /// This convention is used in ASP.NET Web applications.
 117    /// </remarks>
 118    public static string? LoadXslTransformForMemoryInput(string? xslPath, string? commandName,
 119        IXPathNavigable navigableXml)
 0120    {
 0121        ArgumentNullException.ThrowIfNull(navigableXml);
 122
 0123        var navigator = navigableXml.CreateNavigator().ToReferenceTypeValueOrThrow();
 0124        var xmlFragment = navigator.OuterXml;
 0125        var xslArgs = GetXsltArgumentList(commandName);
 126
 0127        return LoadXslTransformForMemoryInput(xslPath, xslArgs, xmlFragment);
 0128    }
 129
 130    /// <summary>
 131    /// Returns a <see cref="string"/>
 132    /// for the transformation of the XSLT file
 133    /// and the XML in-memory fragment.
 134    /// </summary>
 135    /// <param name="xslPath">
 136    /// Output path to the XSLT file.
 137    /// </param>
 138    /// <param name="xslArgs">
 139    /// The <see cref="XsltArgumentList"/>.
 140    /// </param>
 141    /// <param name="xmlFragment">
 142    /// A well-formed XML <see cref="string"/>.
 143    /// </param>
 144    /// <remarks>
 145    /// This convention is used in ASP.NET Web applications.
 146    /// </remarks>
 147    public static string? LoadXslTransformForMemoryInput(string? xslPath, XsltArgumentList? xslArgs,
 148        string? xmlFragment)
 0149    {
 0150        xslPath.ThrowWhenNullOrWhiteSpace();
 0151        xmlFragment.ThrowWhenNullOrWhiteSpace();
 152
 0153        xslArgs ??= new XsltArgumentList();
 154
 0155        var xslt = new XslCompiledTransform(false);
 0156        xslt.Load(xslPath);
 157
 0158        using MemoryStream ms = new MemoryStream();
 0159        using (StringReader sr = new StringReader(xmlFragment))
 0160        {
 0161            XmlReader reader = XmlReader.Create(sr);
 0162            XmlWriter writer = XmlWriter.Create(ms);
 0163            xslt.Transform(reader, xslArgs, writer, null);
 0164        }
 165
 0166        var ret = GetText(ms);
 167
 0168        return ret;
 0169    }
 170
 171    static XsltArgumentList GetXsltArgumentList(string? commandName)
 0172    {
 0173        XsltArgumentList xslArgs = new XsltArgumentList();
 174
 0175        if (!string.IsNullOrWhiteSpace(commandName))
 176            //CONVENTION: XSL templates use a parameter called “cmd”:
 0177            xslArgs.AddParam("cmd", string.Empty, commandName);
 178
 0179        return xslArgs;
 0180    }
 181}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.OutputAs.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Returns strongly typed output, converting the XML fragment.
 7    /// </summary>
 8    /// <typeparam name="TOut">The <see cref="Type"/> of output to return (constrained to <c>class</c>).</typeparam>
 9    /// <param name="xmlFragment">An XML fragment or document as a well-formed <see cref="string"/>.</param>
 10    /// <returns>Returns the specified <see cref="Type"/>.</returns>
 11    /// <remarks>
 12    /// This member only supports <c>TIn</c> as
 13    /// <see cref="string"/>, <see cref="XmlDocument"/> or <see cref="XPathDocument"/>.
 14    /// </remarks>
 15    public static TOut? OutputAs<TOut>(string xmlFragment) where TOut : class
 016    {
 017        if (typeof(TOut).IsAssignableFrom(typeof(string)))
 018        {
 019            return xmlFragment as TOut;
 20        }
 21
 022        XPathDocument? d = GetNavigableDocument(xmlFragment);
 23
 024        return OutputAs<TOut>(d);
 025    }
 26
 27    /// <summary>
 28    /// Returns strongly typed output, converting the Navigable document.
 29    /// </summary>
 30    /// <typeparam name="TOut">The <see cref="Type"/> of output to return (constrained to <c>class</c>).</typeparam>
 31    /// <param name="navigableDocument">An <see cref="IXPathNavigable"/>.</param>
 32    /// <returns>Returns the specified <see cref="Type"/>.</returns>
 33    /// <remarks>
 34    /// This member only supports <c>TIn</c> as
 35    /// <see cref="string"/>, <see cref="XmlDocument"/> or <see cref="XPathDocument"/>.
 36    /// </remarks>
 37    public static TOut? OutputAs<TOut>(IXPathNavigable? navigableDocument) where TOut : class
 038    {
 039        if (navigableDocument == null) return default;
 40
 041        if (typeof(TOut).IsAssignableFrom(typeof(string)))
 042        {
 043            return navigableDocument.CreateNavigator()?.OuterXml as TOut;
 44        }
 45
 046        TOut? stronglyOfTOut = default(TOut);
 047        switch (stronglyOfTOut)
 48        {
 49            case XmlDocument:
 050                XmlDocument dom = new XmlDocument();
 051                dom.LoadXml(navigableDocument.ToString()!);
 52
 053                return dom as TOut;
 54
 55            case XPathDocument:
 056                return navigableDocument as TOut;
 57        }
 58
 059        return default;
 060    }
 61}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.StripNamespaces.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Strip the namespaces from specified <see cref="string"/>.
 7    /// </summary>
 8    /// <param name="xml">
 9    /// The source <see cref="string"/>.
 10    /// </param>
 11    /// <remarks>
 12    /// WARNING: Stripping namespaces “flattens” the document
 13    /// and can cause local-name collisions.
 14    ///
 15    /// This routine does not remove namespace prefixes.
 16    ///
 17    /// </remarks>
 018    public static string? StripNamespaces(string xml) => StripNamespaces(xml, false);
 19
 20    /// <summary>
 21    /// Strip the namespaces from specified <see cref="string"/>.
 22    /// </summary>
 23    /// <param name="xml">
 24    /// The source <see cref="string"/>.
 25    /// </param>
 26    /// <param name="removeDocType">
 27    /// When <c>true</c>, removes any DOCTYPE preambles.
 28    /// </param>
 29    /// <remarks>
 30    /// WARNING: Stripping namespaces “flattens” the document
 31    /// and can cause local-name collisions.
 32    ///
 33    /// This routine does not remove namespace prefixes.
 34    ///
 35    /// </remarks>
 36    public static string? StripNamespaces(string? xml, bool removeDocType)
 037    {
 038        if (string.IsNullOrWhiteSpace(xml)) return null;
 39
 040        if (removeDocType)
 041        {
 042            xml = Regex.Replace(xml,
 043                @"\<\!DOCTYPE [^<]+\>", string.Empty,
 044                RegexOptions.IgnoreCase);
 045        }
 46
 47        //Attempt to remove all namespace prefixes:
 048        foreach (Match m in Regex.Matches(xml,
 049                     @"\s*xmlns:?([^=]*)=[""][^""]*[""]\s*", RegexOptions.IgnoreCase | RegexOptions.Multiline))
 050        {
 051            if (m.Groups.Count != 2) continue;
 52
 53            string pattern;
 54
 055            pattern = m.Groups[1].Value;
 056            pattern = string.Concat("<", pattern, ":");
 057            xml = xml.Replace(pattern, "<");
 58
 059            pattern = m.Groups[1].Value;
 060            pattern = string.Concat("</", pattern, ":");
 061            xml = xml.Replace(pattern, "</");
 062        }
 63
 64        //Attempt to remove namespace declarations:
 065        xml = Regex.Replace(xml,
 066            @"\s*(xmlns:?[^=]*=[""][^""]*[""])\s*", string.Empty,
 067            RegexOptions.IgnoreCase);
 68
 69        //Attempt to remove schemaLocation attribute:
 070        xml = Regex.Replace(xml,
 071            @"\s*([a-zA-z0-9:]*schemaLocation\s*=[""][^""]*[""])\s*", string.Empty,
 072            RegexOptions.IgnoreCase);
 73
 074        return !string.IsNullOrWhiteSpace(xml) ? xml.Trim() : null;
 075    }
 76}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.StripNamespaces.IXPathNavigable.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Strip the namespaces from specified document.
 7    /// </summary>
 8    /// <param name="navigable">
 9    /// The source <see cref="IXPathNavigable"/> document.
 10    /// </param>
 11    /// <remarks>
 12    /// WARNING: Stripping namespaces “flattens” the document
 13    /// and can cause local-name collisions.
 14    ///
 15    /// This routine does not remove namespace prefixes.
 16    ///
 17    /// </remarks>
 18    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 19        Justification = "Specific functionality provided by the concrete type may be required.")]
 020    public static XPathDocument? StripNamespaces(IXPathNavigable? navigable) => StripNamespaces(navigable, false);
 21
 22    /// <summary>
 23    /// Strip the namespaces from specified document.
 24    /// </summary>
 25    /// <param name="navigable">
 26    /// The source <see cref="IXPathNavigable"/> document.
 27    /// </param>
 28    /// <param name="removeDocType">
 29    /// When <c>true</c>, removes any DOCTYPE preambles.
 30    /// </param>
 31    /// <remarks>
 32    /// WARNING: Stripping namespaces “flattens” the document
 33    /// and can cause local-name collisions.
 34    ///
 35    /// This routine does not remove namespace prefixes.
 36    ///
 37    /// </remarks>
 38    [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes",
 39        Justification = "Specific functionality provided by the concrete type may be required.")]
 40    public static XPathDocument? StripNamespaces(IXPathNavigable? navigable, bool removeDocType)
 041    {
 042        if (navigable == null) return null;
 43
 044        XPathNavigator? navigator = navigable.CreateNavigator();
 45
 046        string? xmlString = StripNamespaces(navigator?.OuterXml, removeDocType);
 47
 048        using StringReader s = new StringReader(xmlString!);
 49
 050        var newXml = new XPathDocument(s);
 51
 052        return newXml;
 053    }
 54}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.ValidateNavigableNode.cs

#LineLine coverage
 1using System.Xml.Schema;
 2
 3namespace Songhay.Xml;
 4
 5public static partial class XmlUtility
 6{
 7    /// <summary>
 8    /// Returns an <see cref="XmlSchema"/> based
 9    /// on the specified navigable set and validation event handler.
 10    /// </summary>
 11    /// <param name="navigable">
 12    /// The source <see cref="IXPathNavigable"/> document.
 13    /// </param>
 14    /// <param name="eventHandler">
 15    /// The <see cref="ValidationEventHandler"/>
 16    /// with signature MyHandler(object sender, ValidationEventArgs args).
 17    /// </param>
 18    public static XmlSchema? GetXmlSchema(IXPathNavigable navigable, ValidationEventHandler eventHandler)
 019    {
 020        ArgumentNullException.ThrowIfNull(navigable);
 021        ArgumentNullException.ThrowIfNull(eventHandler);
 22
 023        XPathNavigator? navigator = navigable.CreateNavigator();
 024        if (navigator == null) throw new NullReferenceException("The expected XPath Navigator is not here.");
 25
 026        using StringReader s = new StringReader(navigator.OuterXml);
 027        var schema = XmlSchema.Read(s, eventHandler);
 28
 029        return schema;
 030    }
 31
 32    /// <summary>
 33    /// Loads an <see cref="XmlSchema"/> based
 34    /// on the specified navigable set and validation event handler.
 35    /// </summary>
 36    /// <param name="pathToSchema">
 37    /// The valid path to an XML Schema file.
 38    /// </param>
 39    /// <param name="eventHandler">
 40    /// The <see cref="ValidationEventHandler"/>
 41    /// with signature MyHandler(object sender, ValidationEventArgs args).
 42    /// </param>
 43    public static XmlSchema? LoadXmlSchema(string? pathToSchema, ValidationEventHandler? eventHandler)
 044    {
 045        pathToSchema.ThrowWhenNullOrWhiteSpace();
 46
 047        if (!File.Exists(pathToSchema)) throw new FileNotFoundException(nameof(pathToSchema));
 48
 049        ArgumentNullException.ThrowIfNull(eventHandler);
 50
 051        using XmlTextReader x = new XmlTextReader(pathToSchema);
 052        var schema = XmlSchema.Read(x, eventHandler);
 53
 054        return schema;
 055    }
 56
 57    /// <summary>
 58    /// Validates the specified navigable set
 59    /// with the specified schema and validation event handler.
 60    /// </summary>
 61    /// <param name="navigable">
 62    /// The source <see cref="IXPathNavigable"/> document.
 63    /// </param>
 64    /// <param name="schema">
 65    /// The <see cref="XmlSchema"/>.
 66    /// </param>
 67    /// <param name="eventHandler">
 68    /// The <see cref="ValidationEventHandler"/>
 69    /// with signature MyHandler(object sender, ValidationEventArgs args).
 70    /// </param>
 71    public static void ValidateNavigableNode(IXPathNavigable? navigable, XmlSchema? schema,
 72        ValidationEventHandler? eventHandler)
 073    {
 074        ArgumentNullException.ThrowIfNull(navigable);
 075        ArgumentNullException.ThrowIfNull(schema);
 076        ArgumentNullException.ThrowIfNull(eventHandler);
 77
 078        XmlReaderSettings settings = new XmlReaderSettings();
 079        settings.Schemas.Add(schema);
 080        settings.ValidationType = ValidationType.Schema;
 081        settings.ValidationEventHandler += eventHandler;
 82
 083        XPathNavigator? navigator = navigable.CreateNavigator();
 084        if (navigator == null) throw new NullReferenceException("The expected XPath Navigator is not here.");
 85
 086        using var s = new StringReader(navigator.OuterXml);
 87
 088        XmlReader.Create(s, settings);
 089    }
 90}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.Write.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// Serializes and writes to the specified path.
 7    /// </summary>
 8    /// <typeparam name="T">The type of the instance.</typeparam>
 9    /// <param name="instance">The instance.</param>
 10    /// <param name="path">The path.</param>
 11    public static void Write<T>(T? instance, string? path) where T : class
 112    {
 113        ArgumentNullException.ThrowIfNull(instance);
 14
 115        path.ThrowWhenNullOrWhiteSpace();
 16
 117        var serializer = new XmlSerializer(typeof(T));
 18
 119        XmlWriterSettings settings = new XmlWriterSettings
 120        {
 121            Encoding = Encoding.UTF8,
 122            Indent = true,
 123            IndentChars = "    ",
 124            NewLineOnAttributes = false,
 125            OmitXmlDeclaration = false
 126        };
 27
 128        using var writer = XmlWriter.Create(path, settings);
 29
 130        serializer.Serialize(writer, instance);
 231    }
 32
 33    /// <summary>
 34    /// Transfers the data in the Source to the Destination.
 35    /// </summary>
 36    /// <param name="readerSource">The <see cref="XmlReader"/>.</param>
 37    /// <param name="writerDestination">The <see cref="XmlWriter"/>.</param>
 38    public static void WriteReader(XmlReader? readerSource, XmlWriter? writerDestination)
 039    {
 040        ArgumentNullException.ThrowIfNull(readerSource);
 041        ArgumentNullException.ThrowIfNull(writerDestination);
 42
 043        while (readerSource is {EOF: false}) writerDestination.WriteNode(readerSource, false);
 044    }
 45
 46    /// <summary>
 47    /// Transforms the specified navigable documents
 48    /// and writes to disk with the specified path.
 49    /// </summary>
 50    /// <param name="xmlInput">The specified input.</param>
 51    /// <param name="navigableXsl">
 52    /// The source <see cref="IXPathNavigable"/> document.
 53    /// </param>
 54    /// <param name="outputPath">
 55    /// The file-system, target path.
 56    /// </param>
 57    public static void WriteXslTransform(IXPathNavigable? xmlInput,
 58        IXPathNavigable? navigableXsl, string? outputPath)
 059    {
 060        ArgumentNullException.ThrowIfNull(xmlInput);
 061        ArgumentNullException.ThrowIfNull(navigableXsl);
 062        ArgumentNullException.ThrowIfNull(outputPath);
 63
 064        using var fs = new FileStream(outputPath, FileMode.Create);
 65
 066        var xslt = new XslCompiledTransform(false);
 067        xslt.Load(navigableXsl);
 68
 069        using var sr = new StringReader(xmlInput.CreateNavigator().ToReferenceTypeValueOrThrow().OuterXml);
 070        XmlReader reader = XmlReader.Create(sr);
 071        XmlWriter writer = XmlWriter.Create(fs);
 72
 073        xslt.Transform(reader, null, writer, null);
 074    }
 75
 76    /// <summary>
 77    /// Transforms the specified input and writes to disk.
 78    /// </summary>
 79    /// <param name="xmlInput">The specified input.</param>
 80    /// <param name="navigableXsl">
 81    /// The source <see cref="IXPathNavigable"/> document.
 82    /// </param>
 83    /// <param name="outputPath">
 84    /// The file-system, target path.
 85    /// </param>
 86    public static void WriteXslTransform(XmlReader? xmlInput,
 87        IXPathNavigable? navigableXsl, string? outputPath)
 088    {
 089        ArgumentNullException.ThrowIfNull(xmlInput);
 090        ArgumentNullException.ThrowIfNull(navigableXsl);
 091        outputPath.ThrowWhenNullOrWhiteSpace();
 92
 093        using var fs = new FileStream(outputPath, FileMode.Create);
 94
 095        var xslt = new XslCompiledTransform(false);
 096        xslt.Load(navigableXsl);
 097        XmlWriter writer = XmlWriter.Create(fs);
 98
 099        xslt.Transform(xmlInput, null, writer, null);
 0100    }
 101}

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Xml/XmlUtility.XmlDecode.cs

#LineLine coverage
 1namespace Songhay.Xml;
 2
 3public static partial class XmlUtility
 4{
 5    /// <summary>
 6    /// The conventional HTML entities mapped to their respective glyphs.
 7    /// </summary>
 18    public static readonly Dictionary<string, string> ConventionalHtmlEntities = new()
 19    {
 110        { "&amp;", "&" },
 111        { "&lt;", "<" },
 112        { "&gt;", ">" },
 113        { "&quot;", "\"" },
 114        { "&apos;", "'" },
 115    };
 16
 17    /// <summary>
 18    /// Transforms selected XML glyphs
 19    /// into their respective HTML entities.
 20    /// </summary>
 21    /// <param name="value">The value.</param>
 22    /// <seealso cref="LatinGlyphsUtility.Expand"/>
 23    /// <remarks>This member will preserve HTML comments.</remarks>
 24    public static string? XmlEncode(string? value)
 325    {
 526        if (string.IsNullOrWhiteSpace(value)) return value;
 27
 1328        foreach (var pair in ConventionalHtmlEntities)
 529        {
 530            value = value.Replace(pair.Value, pair.Key);
 531        }
 32
 33        //Preserve comments:
 134        value = value
 135            .Replace("--&gt;", "-->")
 136            .Replace("&lt;!--", "<!--");
 37
 138        return value;
 339    }
 40
 41    /// <summary>
 42    /// Transforms selected HTML entities
 43    /// into their respective glyphs.
 44    /// </summary>
 45    /// <param name="value">The value.</param>
 46    /// <seealso cref="LatinGlyphsUtility.Condense"/>
 47    public static string? XmlDecode(string? value)
 348    {
 549        if (string.IsNullOrWhiteSpace(value)) return value;
 50
 1351        foreach (var pair in ConventionalHtmlEntities)
 552        {
 553            value = value.Replace(pair.Key, pair.Value);
 554        }
 55
 156        return value;
 357    }
 58}

Methods/Properties

CombineNavigableDocuments(System.Xml.XPath.IXPathNavigable,System.Xml.XPath.IXPathNavigable)
CombineNavigableDocuments(System.Xml.XPath.IXPathNavigable,System.Xml.XPath.IXPathNavigable,System.String)
GetInstance(System.String)
GetInstanceRaw(System.String)
GetInternalMessage(System.String)
GetInternalMessage(System.String,System.String[])
GetInternalMessage(System.String,System.Collections.ObjectModel.ReadOnlyCollection`1<System.String>)
GetInternalMessage(System.String,System.String,System.Collections.Generic.IEnumerable`1<System.String>)
GetInternalMessage(System.String,System.String[],System.Xml.XmlWriter)
GetInternalMessage(System.String,System.String,System.String[],System.Xml.XmlWriter)
GetInternalMessage(System.String,System.String[],System.Xml.XmlWriter,System.Boolean)
GetInternalMessage(System.String,System.String,System.String[],System.Xml.XmlWriter,System.Boolean)
GetInternalMessageDocument(System.String,System.String[])
GetInternalMessageDocument(System.String,System.String,System.String[])
GetNamespaceManager(System.Xml.XPath.IXPathNavigable)
GetNavigableDocument(System.String)
GetNavigableDocument(System.Xml.XPath.IXPathNavigable)
GetNavigableDocument(System.IO.Stream)
GetNavigableNode(System.Xml.XPath.IXPathNavigable,System.String)
GetNavigableNode(System.Xml.XPath.IXPathNavigable,System.String,System.Xml.XmlNamespaceManager)
GetNavigableNodes(System.Xml.XPath.IXPathNavigable,System.String)
GetNavigableNodes(System.Xml.XPath.IXPathNavigable,System.String,System.Xml.XmlNamespaceManager)
GetNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean)
GetNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,System.Object)
GetNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,System.Object,System.Xml.XmlNamespaceManager)
GetNodeValueAndParse(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,T)
GetNodeValueAndParse(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,T,System.Xml.XmlNamespaceManager)
GetText(System.IO.MemoryStream)
GetXslResult(System.Xml.XPath.IXPathNavigable,System.Xml.XPath.IXPathNavigable)
GetXslResult(System.Xml.XPath.IXPathNavigable,System.Xml.Xsl.XsltArgumentList,System.Xml.XPath.IXPathNavigable)
GetXslString(System.Xml.XPath.IXPathNavigable,System.Xml.XPath.IXPathNavigable)
GetXslString(System.Xml.XPath.IXPathNavigable,System.Xml.Xsl.XsltArgumentList,System.Xml.XPath.IXPathNavigable)
GetXslString(System.Xml.XPath.IXPathNavigable,System.Xml.Xsl.XsltArgumentList,System.Xml.XPath.IXPathNavigable,System.Xml.XmlWriterSettings)
InputAs(TIn)
IsNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,System.String)
IsNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,System.String,System.StringComparison)
IsNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,System.String,System.Xml.XmlNamespaceManager)
IsNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean,System.String,System.Xml.XmlNamespaceManager,System.StringComparison)
IsNoNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean)
IsYesNodeValue(System.Xml.XPath.IXPathNavigable,System.String,System.Boolean)
IsXml(System.String)
LoadXslTransform(System.String,System.String)
LoadXslTransform(System.String,System.String,System.String)
LoadXslTransform(System.String,System.Xml.Xsl.XsltArgumentList,System.String)
LoadXslTransformForMemoryInput(System.String,System.String,System.String)
LoadXslTransformForMemoryInput(System.String,System.String,System.Xml.XPath.IXPathNavigable)
LoadXslTransformForMemoryInput(System.String,System.Xml.Xsl.XsltArgumentList,System.String)
GetXsltArgumentList(System.String)
OutputAs(System.String)
OutputAs(System.Xml.XPath.IXPathNavigable)
StripNamespaces(System.String)
StripNamespaces(System.String,System.Boolean)
StripNamespaces(System.Xml.XPath.IXPathNavigable)
StripNamespaces(System.Xml.XPath.IXPathNavigable,System.Boolean)
GetXmlSchema(System.Xml.XPath.IXPathNavigable,System.Xml.Schema.ValidationEventHandler)
LoadXmlSchema(System.String,System.Xml.Schema.ValidationEventHandler)
ValidateNavigableNode(System.Xml.XPath.IXPathNavigable,System.Xml.Schema.XmlSchema,System.Xml.Schema.ValidationEventHandler)
Write(T,System.String)
WriteReader(System.Xml.XmlReader,System.Xml.XmlWriter)
WriteXslTransform(System.Xml.XPath.IXPathNavigable,System.Xml.XPath.IXPathNavigable,System.String)
WriteXslTransform(System.Xml.XmlReader,System.Xml.XPath.IXPathNavigable,System.String)
.cctor()
XmlEncode(System.String)
XmlDecode(System.String)