Show / Hide Table of Contents

    Class DOMUtils

    Helper methods for parsing XML

    Inheritance
    System.Object
    DOMUtils
    Namespace: Lucene.Net.QueryParsers.Xml
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    public class DOMUtils : object

    Methods

    | Improve this Doc View Source

    GetAttribute(XmlElement, String, Boolean)

    Declaration
    public static bool GetAttribute(XmlElement element, string attributeName, bool deflt)
    Parameters
    Type Name Description
    XmlElement element
    System.String attributeName
    System.Boolean deflt
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetAttribute(XmlElement, String, Int32)

    Declaration
    public static int GetAttribute(XmlElement element, string attributeName, int deflt)
    Parameters
    Type Name Description
    XmlElement element
    System.String attributeName
    System.Int32 deflt
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    GetAttribute(XmlElement, String, Single)

    Declaration
    public static float GetAttribute(XmlElement element, string attributeName, float deflt)
    Parameters
    Type Name Description
    XmlElement element
    System.String attributeName
    System.Single deflt
    Returns
    Type Description
    System.Single
    | Improve this Doc View Source

    GetAttribute(XmlElement, String, String)

    Declaration
    public static string GetAttribute(XmlElement element, string attributeName, string deflt)
    Parameters
    Type Name Description
    XmlElement element
    System.String attributeName
    System.String deflt
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetAttributeOrFail(XmlElement, String)

    Declaration
    public static string GetAttributeOrFail(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    System.String name
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetAttributeWithInheritance(XmlElement, String)

    Returns an attribute value from this node, or first parent node with this attribute defined

    Declaration
    public static string GetAttributeWithInheritance(XmlElement element, string attributeName)
    Parameters
    Type Name Description
    XmlElement element
    System.String attributeName
    Returns
    Type Description
    System.String

    A non-zero-length value if defined, otherwise null

    | Improve this Doc View Source

    GetAttributeWithInheritanceOrFail(XmlElement, String)

    Declaration
    public static string GetAttributeWithInheritanceOrFail(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    System.String name
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetChildByTagName(XmlElement, String)

    Convenience method where there is only one child of a given name

    Declaration
    public static XmlElement GetChildByTagName(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    System.String name
    Returns
    Type Description
    XmlElement
    | Improve this Doc View Source

    GetChildByTagOrFail(XmlElement, String)

    Declaration
    public static XmlElement GetChildByTagOrFail(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    System.String name
    Returns
    Type Description
    XmlElement
    | Improve this Doc View Source

    GetChildTextByTagName(XmlElement, String)

    Convenience method where there is only one child of a given name

    Declaration
    public static string GetChildTextByTagName(XmlElement e, string tagName)
    Parameters
    Type Name Description
    XmlElement e
    System.String tagName
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetFirstChildElement(XmlElement)

    Declaration
    public static XmlElement GetFirstChildElement(XmlElement element)
    Parameters
    Type Name Description
    XmlElement element
    Returns
    Type Description
    XmlElement
    | Improve this Doc View Source

    GetFirstChildOrFail(XmlElement)

    Declaration
    public static XmlElement GetFirstChildOrFail(XmlElement e)
    Parameters
    Type Name Description
    XmlElement e
    Returns
    Type Description
    XmlElement
    | Improve this Doc View Source

    GetNonBlankTextOrFail(XmlElement)

    Declaration
    public static string GetNonBlankTextOrFail(XmlElement e)
    Parameters
    Type Name Description
    XmlElement e
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetText(XmlNode)

    Declaration
    public static string GetText(XmlNode e)
    Parameters
    Type Name Description
    XmlNode e
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    InsertChild(XmlElement, String, String)

    Convenience method to append a new child with text

    Declaration
    public static XmlElement InsertChild(XmlElement parent, string tagName, string text)
    Parameters
    Type Name Description
    XmlElement parent
    System.String tagName
    System.String text
    Returns
    Type Description
    XmlElement
    | Improve this Doc View Source

    LoadXML(Stream)

    Helper method to parse an XML file into a DOM tree, given a .

    Declaration
    public static XmlDocument LoadXML(Stream input)
    Parameters
    Type Name Description
    Stream input

    reader of the XML file to be parsed

    Returns
    Type Description
    XmlDocument

    an object

    | Improve this Doc View Source

    LoadXML(TextReader)

    Helper method to parse an XML file into a DOM tree, given a .

    Declaration
    public static XmlDocument LoadXML(TextReader input)
    Parameters
    Type Name Description
    TextReader input

    reader of the XML file to be parsed

    Returns
    Type Description
    XmlDocument

    an object

    | Improve this Doc View Source

    LoadXML(XmlReader)

    Helper method to parse an XML file into a DOM tree, given an .

    Declaration
    public static XmlDocument LoadXML(XmlReader input)
    Parameters
    Type Name Description
    XmlReader input

    reader of the XML file to be parsed

    Returns
    Type Description
    XmlDocument

    an object

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)