Show / Hide Table of Contents

    Class Parser

    The SAX parser class.

    Inheritance
    System.Object
    DefaultHandler
    Parser
    Implements
    IEntityResolver
    IDTDHandler
    IContentHandler
    IErrorHandler
    IScanHandler
    IXMLReader
    ILexicalHandler
    Inherited Members
    DefaultHandler.ResolveEntity(String, String)
    DefaultHandler.NotationDecl(String, String, String)
    DefaultHandler.UnparsedEntityDecl(String, String, String, String)
    DefaultHandler.SetDocumentLocator(ILocator)
    DefaultHandler.StartDocument()
    DefaultHandler.EndDocument()
    DefaultHandler.StartPrefixMapping(String, String)
    DefaultHandler.EndPrefixMapping(String)
    DefaultHandler.StartElement(String, String, String, IAttributes)
    DefaultHandler.EndElement(String, String, String)
    DefaultHandler.Characters(Char[], Int32, Int32)
    DefaultHandler.IgnorableWhitespace(Char[], Int32, Int32)
    DefaultHandler.ProcessingInstruction(String, String)
    DefaultHandler.SkippedEntity(String)
    DefaultHandler.Warning(SAXParseException)
    DefaultHandler.Error(SAXParseException)
    DefaultHandler.FatalError(SAXParseException)
    Namespace: TagSoup
    Assembly: Lucene.Net.Benchmark.dll
    Syntax
    public class Parser : DefaultHandler, IEntityResolver, IDTDHandler, IContentHandler, IErrorHandler, IScanHandler, IXMLReader, ILexicalHandler

    Constructors

    | Improve this Doc View Source

    Parser()

    Creates a new instance of Parser

    Declaration
    public Parser()

    Fields

    | Improve this Doc View Source

    AUTO_DETECTOR_PROPERTY

    Specifies the AutoDetector (for encoding detection) this Parser uses.

    Declaration
    public const string AUTO_DETECTOR_PROPERTY = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    BOGONS_EMPTY_FEATURE

    A value of true indicates that the parser will give unknown elements a content model of EMPTY; a value of false, a content model of ANY.

    Declaration
    public const string BOGONS_EMPTY_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    CDATA_ELEMENTS_FEATURE

    A value of "true" indicates that the parser will treat CDATA elements specially. Normally true, since the input is by default HTML.

    Declaration
    public const string CDATA_ELEMENTS_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    DEFAULT_ATTRIBUTES_FEATURE

    A value of true indicates that the parser will return default attribute values for missing attributes that have default values.

    Declaration
    public const string DEFAULT_ATTRIBUTES_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    EXTERNAL_GENERAL_ENTITIES_FEATURE

    Reports whether this parser processes external general entities (it doe

    Declaration
    public const string EXTERNAL_GENERAL_ENTITIES_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    EXTERNAL_PARAMETER_ENTITIES_FEATURE

    Reports whether this parser processes external parameter entities (it doesn't).

    Declaration
    public const string EXTERNAL_PARAMETER_ENTITIES_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    IGNORABLE_WHITESPACE_FEATURE

    A value of "true" indicates that the parser will transmit whitespace in element-only content via the SAX ignorableWhitespace callback. Normally this is not done, because HTML is an SGML application and SGML suppresses such whitespace.

    Declaration
    public const string IGNORABLE_WHITESPACE_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    IGNORE_BOGONS_FEATURE

    A value of true indicates that the parser will ignore unknown elements.

    Declaration
    public const string IGNORE_BOGONS_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    IS_STANDALONE_FEATURE

    May be examined only during a parse, after the startDocument() callback has been completed; read-only. The value is true if the document specified standalone="yes" in its XML declaration, and otherwise is false. (It's always false.)

    Declaration
    public const string IS_STANDALONE_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE

    A value of "true" indicates that the LexicalHandler will report the beginning and end of parameter entities (it won't).

    Declaration
    public const string LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    LEXICAL_HANDLER_PROPERTY

    Used to see some syntax events that are essential in some applications: comments, CDATA delimiters, selected general entity inclusions, and the start and end of the DTD (and declaration of document element name). The Object must implement ILexicalHandler

    Declaration
    public const string LEXICAL_HANDLER_PROPERTY = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    NAMESPACE_PREFIXES_FEATURE

    A value of "true" indicates that XML qualified names (with prefixes) and attributes (including xmlns* attributes) will be available. We don't support this value.

    Declaration
    public const string NAMESPACE_PREFIXES_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    NAMESPACES_FEATURE

    A value of "true" indicates namespace URIs and unprefixed local names for element and attribute names will be available.

    Declaration
    public const string NAMESPACES_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    RESOLVE_DTD_URIS_FEATURE

    A value of "true" indicates that system IDs in declarations will be absolutized (relative to their base URIs) before reporting. (This returns true but doesn't actually do anything.)

    Declaration
    public const string RESOLVE_DTD_URIS_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    RESTART_ELEMENTS_FEATURE

    A value of true indicates that the parser will attempt to restart the restartable elements.

    Declaration
    public const string RESTART_ELEMENTS_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    ROOT_BOGONS_FEATURE

    A value of true indicates that the parser will allow unknown elements to be the root element.

    Declaration
    public const string ROOT_BOGONS_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    SCANNER_PROPERTY

    Specifies the Scanner object this Parser uses.

    Declaration
    public const string SCANNER_PROPERTY = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    SCHEMA_PROPERTY

    Specifies the Schema object this Parser uses.

    Declaration
    public const string SCHEMA_PROPERTY = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    STRING_INTERNING_FEATURE

    Has a value of "true" if all XML names (for elements, prefixes, attributes, entities, notations, and local names), as well as Namespace URIs, will have been interned using . This supports fast testing of equality/inequality against string constants, rather than forcing slower calls to . (We always intern.)

    Declaration
    public const string STRING_INTERNING_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    TRANSLATE_COLONS_FEATURE

    A value of true indicates that the parser will translate colons into underscores in names.

    Declaration
    public const string TRANSLATE_COLONS_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    UNICODE_NORMALIZATION_CHECKING_FEATURE

    Controls whether the parser reports Unicode normalization errors as described in section 2.13 and Appendix B of the XML 1.1 Recommendation. (We don't normalize.)

    Declaration
    public const string UNICODE_NORMALIZATION_CHECKING_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    USE_ATTRIBUTES2_FEATURE

    Returns "true" if the Attributes objects passed by this parser in StartElement(String, String, String, IAttributes) implement the IAttributes2 interface. (They don't.)

    Declaration
    public const string USE_ATTRIBUTES2_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    USE_ENTITY_RESOLVER2_FEATURE

    Returns "true" if, when setEntityResolver is given an object implementing the IEntityResolver2 interface, those new methods will be used. (They won't be.)

    Declaration
    public const string USE_ENTITY_RESOLVER2_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    USE_LOCATOR2_FEATURE

    Returns "true" if the Locator objects passed by this parser parser in SetDocumentLocator(ILocator) implement the ILocator2 interface. (They don't.)

    Declaration
    public const string USE_LOCATOR2_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    VALIDATION_FEATURE

    Controls whether the parser is reporting all validity errors (We don't report any validity errors.)

    Declaration
    public const string VALIDATION_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    XML11_FEATURE

    Returns true if the parser supports both XML 1.1 and XML 1.0. (Always false.)

    Declaration
    public const string XML11_FEATURE = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    XMLNS_URIS_FEATURE

    Controls whether, when the namespace-prefixes feature is set, the parser treats namespace declaration attributes as being in the http://www.w3.org/2000/xmlns/ namespace. (It doesn't.)

    Declaration
    public const string XMLNS_URIS_FEATURE = null
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc View Source

    ContentHandler

    Declaration
    public virtual IContentHandler ContentHandler { get; set; }
    Property Value
    Type Description
    IContentHandler
    | Improve this Doc View Source

    DTDHandler

    Declaration
    public virtual IDTDHandler DTDHandler { get; set; }
    Property Value
    Type Description
    IDTDHandler
    | Improve this Doc View Source

    EntityResolver

    Declaration
    public virtual IEntityResolver EntityResolver { get; set; }
    Property Value
    Type Description
    IEntityResolver
    | Improve this Doc View Source

    ErrorHandler

    Declaration
    public virtual IErrorHandler ErrorHandler { get; set; }
    Property Value
    Type Description
    IErrorHandler

    Methods

    | Improve this Doc View Source

    Adup(Char[], Int32, Int32)

    Declaration
    public virtual void Adup(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    Aname(Char[], Int32, Int32)

    Declaration
    public virtual void Aname(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    Aval(Char[], Int32, Int32)

    Declaration
    public virtual void Aval(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    CDSect(Char[], Int32, Int32)

    Declaration
    public virtual void CDSect(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    Cmnt(Char[], Int32, Int32)

    Declaration
    public virtual void Cmnt(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    Comment(Char[], Int32, Int32)

    Declaration
    public virtual void Comment(char[] ch, int start, int length)
    Parameters
    Type Name Description
    System.Char[] ch
    System.Int32 start
    System.Int32 length
    | Improve this Doc View Source

    Decl(Char[], Int32, Int32)

    Parsing the complete XML Document Type Definition is way too complex, but for many simple cases we can extract something useful from it. doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>' DeclSep ::= PEReference | S intSubset ::= (markupdecl | DeclSep)* markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral

    Declaration
    public virtual void Decl(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    EndCDATA()

    Declaration
    public virtual void EndCDATA()
    | Improve this Doc View Source

    EndDTD()

    Declaration
    public virtual void EndDTD()
    | Improve this Doc View Source

    EndEntity(String)

    Declaration
    public virtual void EndEntity(string name)
    Parameters
    Type Name Description
    System.String name
    | Improve this Doc View Source

    Entity(Char[], Int32, Int32)

    Declaration
    public virtual void Entity(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    EOF(Char[], Int32, Int32)

    Declaration
    public virtual void EOF(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    ETag(Char[], Int32, Int32)

    Declaration
    public virtual void ETag(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    ETagBasic(Char[], Int32, Int32)

    Declaration
    public virtual void ETagBasic(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    ETagCdata(Char[], Int32, Int32)

    Declaration
    public virtual bool ETagCdata(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetEntity()

    Declaration
    public virtual int GetEntity()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    GetFeature(String)

    Declaration
    public virtual bool GetFeature(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetProperty(String)

    Declaration
    public virtual object GetProperty(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    System.Object
    | Improve this Doc View Source

    GI(Char[], Int32, Int32)

    Declaration
    public virtual void GI(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    Parse(InputSource)

    Declaration
    public virtual void Parse(InputSource input)
    Parameters
    Type Name Description
    InputSource input
    | Improve this Doc View Source

    Parse(String)

    Declaration
    public virtual void Parse(string systemid)
    Parameters
    Type Name Description
    System.String systemid
    | Improve this Doc View Source

    PCDATA(Char[], Int32, Int32)

    Declaration
    public virtual void PCDATA(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    PI(Char[], Int32, Int32)

    Declaration
    public virtual void PI(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    PITarget(Char[], Int32, Int32)

    Declaration
    public virtual void PITarget(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    SetFeature(String, Boolean)

    Declaration
    public virtual void SetFeature(string name, bool value)
    Parameters
    Type Name Description
    System.String name
    System.Boolean value
    | Improve this Doc View Source

    SetProperty(String, Object)

    Declaration
    public virtual void SetProperty(string name, object value)
    Parameters
    Type Name Description
    System.String name
    System.Object value
    | Improve this Doc View Source

    STagC(Char[], Int32, Int32)

    Declaration
    public virtual void STagC(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    STagE(Char[], Int32, Int32)

    Declaration
    public virtual void STagE(char[] buff, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buff
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    StartCDATA()

    Declaration
    public virtual void StartCDATA()
    | Improve this Doc View Source

    StartDTD(String, String, String)

    Declaration
    public virtual void StartDTD(string name, string publicid, string systemid)
    Parameters
    Type Name Description
    System.String name
    System.String publicid
    System.String systemid
    | Improve this Doc View Source

    StartEntity(String)

    Declaration
    public virtual void StartEntity(string name)
    Parameters
    Type Name Description
    System.String name

    Implements

    IEntityResolver
    IDTDHandler
    IContentHandler
    IErrorHandler
    IScanHandler
    IXMLReader
    ILexicalHandler
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)