Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class DOMUtils

    Helper methods for parsing XML

    Inheritance
    object
    DOMUtils
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.QueryParsers.Xml
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    public static class DOMUtils

    Methods

    GetAttribute(XmlElement, string, bool)

    Helper methods for parsing XML

    Declaration
    public static bool GetAttribute(XmlElement element, string attributeName, bool deflt)
    Parameters
    Type Name Description
    XmlElement element
    string attributeName
    bool deflt
    Returns
    Type Description
    bool

    GetAttribute(XmlElement, string, int)

    Helper methods for parsing XML

    Declaration
    public static int GetAttribute(XmlElement element, string attributeName, int deflt)
    Parameters
    Type Name Description
    XmlElement element
    string attributeName
    int deflt
    Returns
    Type Description
    int

    GetAttribute(XmlElement, string, float)

    Helper methods for parsing XML

    Declaration
    public static float GetAttribute(XmlElement element, string attributeName, float deflt)
    Parameters
    Type Name Description
    XmlElement element
    string attributeName
    float deflt
    Returns
    Type Description
    float

    GetAttribute(XmlElement, string, string)

    Helper methods for parsing XML

    Declaration
    public static string GetAttribute(XmlElement element, string attributeName, string deflt)
    Parameters
    Type Name Description
    XmlElement element
    string attributeName
    string deflt
    Returns
    Type Description
    string

    GetAttributeOrFail(XmlElement, string)

    Helper methods for parsing XML

    Declaration
    public static string GetAttributeOrFail(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    string name
    Returns
    Type Description
    string

    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
    string attributeName
    Returns
    Type Description
    string

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

    GetAttributeWithInheritanceOrFail(XmlElement, string)

    Helper methods for parsing XML

    Declaration
    public static string GetAttributeWithInheritanceOrFail(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    string name
    Returns
    Type Description
    string

    GetChildByTagName(XmlElement, string)

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

    Declaration
    public static XmlElement GetChildByTagName(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    string name
    Returns
    Type Description
    XmlElement

    GetChildByTagOrFail(XmlElement, string)

    Helper methods for parsing XML

    Declaration
    public static XmlElement GetChildByTagOrFail(XmlElement e, string name)
    Parameters
    Type Name Description
    XmlElement e
    string name
    Returns
    Type Description
    XmlElement

    GetChildTextByTagName(XmlElement, string)

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

    Declaration
    public static string GetChildTextByTagName(XmlElement e, string tagName)
    Parameters
    Type Name Description
    XmlElement e
    string tagName
    Returns
    Type Description
    string

    GetFirstChildElement(XmlElement)

    Helper methods for parsing XML

    Declaration
    public static XmlElement GetFirstChildElement(XmlElement element)
    Parameters
    Type Name Description
    XmlElement element
    Returns
    Type Description
    XmlElement

    GetFirstChildOrFail(XmlElement)

    Helper methods for parsing XML

    Declaration
    public static XmlElement GetFirstChildOrFail(XmlElement e)
    Parameters
    Type Name Description
    XmlElement e
    Returns
    Type Description
    XmlElement

    GetNonBlankTextOrFail(XmlElement)

    Helper methods for parsing XML

    Declaration
    public static string GetNonBlankTextOrFail(XmlElement e)
    Parameters
    Type Name Description
    XmlElement e
    Returns
    Type Description
    string

    GetText(XmlNode)

    Helper methods for parsing XML

    Declaration
    public static string GetText(XmlNode e)
    Parameters
    Type Name Description
    XmlNode e
    Returns
    Type Description
    string

    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
    string tagName
    string text
    Returns
    Type Description
    XmlElement

    LoadXML(Stream)

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

    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 XmlDocument object

    LoadXML(TextReader)

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

    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 XmlDocument object

    LoadXML(XmlReader)

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

    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 XmlDocument object

    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.