Show / Hide Table of Contents

    Class XmlReaderUtility

    This utility class is designed to make System.Xml.XmlReader related operations easier to work with.

    Inheritance
    System.Object
    XmlReaderUtility
    Namespace: Cuemon.Xml
    Assembly: Cuemon.Xml.dll
    Syntax
    public static class XmlReaderUtility

    Methods

    | Improve this Doc

    Chunk(XmlReader)

    Creates and returns a chunked sequence of System.Xml.XmlReader objects with a maximum of 128 XML node elements located on a depth of 1.

    Declaration
    public static IEnumerable<XmlReader> Chunk(XmlReader reader)
    Parameters
    Type Name Description
    System.Xml.XmlReader reader

    The System.Xml.XmlReader object that contains the XML data to chunk into smaller System.Xml.XmlReader objects for a batch run or similar.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Xml.XmlReader>

    An sequence of System.Xml.XmlReader objects that contains no more than 128 XML node elements from the reader object.

    | Improve this Doc

    Chunk(XmlReader, Int32, Action<XmlWriterSettings>)

    Creates and returns a chunked sequence of System.Xml.XmlReader objects with a maximum of the specified size of XML node elements located on a depth of 1.

    Declaration
    public static IEnumerable<XmlReader> Chunk(XmlReader reader, int size, Action<XmlWriterSettings> setup = null)
    Parameters
    Type Name Description
    System.Xml.XmlReader reader

    The System.Xml.XmlReader object that contains the XML data to chunk into smaller System.Xml.XmlReader objects for a batch run or similar.

    System.Int32 size

    The amount of XML node elements allowed per System.Xml.XmlReader object. Default is 128 XML node element.

    System.Action<System.Xml.XmlWriterSettings> setup

    The System.Xml.XmlWriterSettings which need to be configured.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Xml.XmlReader>

    An sequence of System.Xml.XmlReader objects that contains no more than the specified size of XML node elements from the reader object.

    Exceptions
    Type Condition
    System.ArgumentNullException

    reader is null.

    System.ArgumentException

    The System.Xml.XmlReader.Read() method of the reader object has already been called.

    | Improve this Doc

    CreateSettings(Action<XmlReaderSettings>)

    Specifies a set of features to support the System.Xml.XmlReader object.

    Declaration
    public static XmlReaderSettings CreateSettings(Action<XmlReaderSettings> setup = null)
    Parameters
    Type Name Description
    System.Action<System.Xml.XmlReaderSettings> setup
    Returns
    Type Description
    System.Xml.XmlReaderSettings

    A System.Xml.XmlReaderSettings instance that specifies a set of features to support the System.Xml.XmlReader object.

    Remarks

    The following table shows the overridden initial property values for an instance of System.Xml.XmlReaderSettings.
    The initial property values can be viewed here: https://msdn.microsoft.com/EN-US/library/2ycwc04f(v=VS.110,d=hv.2).aspx

    PropertyInitial Value
    System.Xml.XmlReaderSettings.DtdProcessingSystem.Xml.DtdProcessing.Ignore
    | Improve this Doc

    MoveToFirstElement(XmlReader)

    Moves the reader object to the first element.

    Declaration
    public static bool MoveToFirstElement(XmlReader reader)
    Parameters
    Type Name Description
    System.Xml.XmlReader reader

    The System.Xml.XmlReader object that contains the XML data.

    Returns
    Type Description
    System.Boolean

    true if an element exists (the reader moves to the first element), otherwise, false (the reader has reached System.Xml.XmlReader.EOF).

    Exceptions
    Type Condition
    System.ArgumentNullException

    reader is null.

    System.ArgumentException

    The System.Xml.XmlReader.Read() method of the reader object has already been called.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX