{
    "mode": "perldoc",
    "parameter": "XML::Parser::PerlSAX",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AParser%3A%3APerlSAX/json",
    "generated": "2026-06-11T00:23:46Z",
    "synopsis": "use XML::Parser::PerlSAX;\n$parser = XML::Parser::PerlSAX->new( [OPTIONS] );\n$result = $parser->parse( [OPTIONS] );\n$result = $parser->parse($string);",
    "sections": {
        "NAME": {
            "content": "XML::Parser::PerlSAX - Perl SAX parser using XML::Parser\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::Parser::PerlSAX;\n\n$parser = XML::Parser::PerlSAX->new( [OPTIONS] );\n$result = $parser->parse( [OPTIONS] );\n\n$result = $parser->parse($string);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"XML::Parser::PerlSAX\" is a PerlSAX parser using the XML::Parser module. This man page\nsummarizes the specific options, handlers, and properties supported by \"XML::Parser::PerlSAX\";\nplease refer to the PerlSAX standard in `\"PerlSAX.pod\"' for general usage information.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "new Creates a new parser object. Default options for parsing, described below, are passed as\nkey-value pairs or as a single hash. Options may be changed directly in the parser object\nunless stated otherwise. Options passed to `\"parse()\"' override the default options in the\nparser object for the duration of the parse.\n\nparse\nParses a document. Options, described below, are passed as key-value pairs or as a single\nhash. Options passed to `\"parse()\"' override default options in the parser object.\n\nlocation\nReturns the location as a hash:\n\nColumnNumber    The column number of the parse.\nLineNumber      The line number of the parse.\nBytePosition    The current byte position of the parse.\nPublicId        A string containing the public identifier, or undef\nif none is available.\nSystemId        A string containing the system identifier, or undef\nif none is available.\nBase            The current value of the base for resolving relative\nURIs.\n\nALPHA WARNING: The `\"SystemId\"' and `\"PublicId\"' properties returned are the system and\npublic identifiers of the document passed to `\"parse()\"', not the identifiers of the\ncurrently parsing external entity. The column, line, and byte positions *are* of the current\nentity being parsed.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The following options are supported by \"XML::Parser::PerlSAX\":\n\nHandler          default handler to receive events\nDocumentHandler  handler to receive document events\nDTDHandler       handler to receive DTD events\nErrorHandler     handler to receive error events\nEntityResolver   handler to resolve entities\nLocale           locale to provide localisation for errors\nSource           hash containing the input source for parsing\nUseAttributeOrder set to true to provide AttributeOrder and Defaulted\nproperties in `startelement()'\n\nIf no handlers are provided then all events will be silently ignored, except for\n`\"fatalerror()\"' which will cause a `\"die()\"' to be called after calling `\"enddocument()\"'.\n\nIf a single string argument is passed to the `\"parse()\"' method, it is treated as if a\n`\"Source\"' option was given with a `\"String\"' parameter.\n\nThe `\"Source\"' hash may contain the following parameters:\n\nByteStream       The raw byte stream (file handle) containing the\ndocument.\nString           A string containing the document.\nSystemId         The system identifier (URI) of the document.\nPublicId         The public identifier.\nEncoding         A string describing the character encoding.\n\nIf more than one of `\"ByteStream\"', `\"String\"', or `\"SystemId\"', then preference is given first\nto `\"ByteStream\"', then `\"String\"', then `\"SystemId\"'.\n",
            "subsections": []
        },
        "HANDLERS": {
            "content": "The following handlers and properties are supported by \"XML::Parser::PerlSAX\":\n",
            "subsections": [
                {
                    "name": "DocumentHandler methods",
                    "content": "startdocument\nReceive notification of the beginning of a document.\n\nNo properties defined.\n\nenddocument\nReceive notification of the end of a document.\n\nNo properties defined.\n\nstartelement\nReceive notification of the beginning of an element.\n\nName             The element type name.\nAttributes       A hash containing the attributes attached to the\nelement, if any.\n\nThe `\"Attributes\"' hash contains only string values.\n\nIf the `\"UseAttributeOrder\"' parser option is true, the following properties are also passed\nto `\"startelement\"':\n\nAttributeOrder   An array of attribute names in the order they were\nspecified, followed by the defaulted attribute\nnames.\nDefaulted        The index number of the first defaulted attribute in\n`AttributeOrder.  If this index is equal to the\nlength of `AttributeOrder', there were no defaulted\nvalues.\n\nNote to \"XML::Parser\" users: `\"Defaulted\"' will be half the value of \"XML::Parser::Expat\"'s\n`\"specifiedattr()\"' function because only attribute names are provided, not their values.\n\nendelement\nReceive notification of the end of an element.\n\nName             The element type name.\n\ncharacters\nReceive notification of character data.\n\nData             The characters from the XML document.\n\nprocessinginstruction\nReceive notification of a processing instruction.\n\nTarget           The processing instruction target.\nData             The processing instruction data, if any.\n\ncomment\nReceive notification of a comment.\n\nData             The comment data, if any.\n\nstartcdata\nReceive notification of the start of a CDATA section.\n\nNo properties defined.\n\nendcdata\nReceive notification of the end of a CDATA section.\n\nNo properties defined.\n\nentityreference\nReceive notification of an internal entity reference. If this handler is defined, internal\nentities will not be expanded and not passed to the `\"characters()\"' handler. If this\nhandler is not defined, internal entities will be expanded if possible and passed to the\n`\"characters()\"' handler.\n\nName             The entity reference name\nValue            The entity reference value\n\nDTDHandler methods\nnotationdecl\nReceive notification of a notation declaration event.\n\nName             The notation name.\nPublicId         The notation's public identifier, if any.\nSystemId         The notation's system identifier, if any.\nBase             The base for resolving a relative URI, if any.\n\nunparsedentitydecl\nReceive notification of an unparsed entity declaration event.\n\nName             The unparsed entity's name.\nSystemId         The entity's system identifier.\nPublicId         The entity's public identifier, if any.\nBase             The base for resolving a relative URI, if any.\n\nentitydecl\nReceive notification of an entity declaration event.\n\nName             The entity name.\nValue            The entity value, if any.\nPublicId         The notation's public identifier, if any.\nSystemId         The notation's system identifier, if any.\nNotation         The notation declared for this entity, if any.\n\nFor internal entities, the `\"Value\"' parameter will contain the value and the `\"PublicId\"',\n`\"SystemId\"', and `\"Notation\"' will be undefined. For external entities, the `\"Value\"'\nparameter will be undefined, the `\"SystemId\"' parameter will have the system id, the\n`\"PublicId\"' parameter will have the public id if it was provided (it will be undefined\notherwise), the `\"Notation\"' parameter will contain the notation name for unparsed entities.\nIf this is a parameter entity declaration, then a '%' will be prefixed to the entity name.\n\nNote that `\"entitydecl()\"' and `\"unparsedentitydecl()\"' overlap. If both methods are\nimplemented by a handler, then this handler will not be called for unparsed entities.\n\nelementdecl\nReceive notification of an element declaration event.\n\nName             The element type name.\nModel            The content model as a string.\n\nattlistdecl\nReceive notification of an attribute list declaration event.\n\nThis handler is called for each attribute in an ATTLIST declaration found in the internal\nsubset. So an ATTLIST declaration that has multiple attributes will generate multiple calls\nto this handler.\n\nElementName      The element type name.\nAttributeName    The attribute name.\nType             The attribute type.\nFixed            True if this is a fixed attribute.\n\nThe default for `\"Type\"' is the default value, which will either be \"#REQUIRED\", \"#IMPLIED\"\nor a quoted string (i.e. the returned string will begin and end with a quote character).\n\ndoctypedecl\nReceive notification of a DOCTYPE declaration event.\n\nName             The document type name.\nSystemId         The document's system identifier.\nPublicId         The document's public identifier, if any.\nInternal         The internal subset as a string, if any.\n\nInternal will contain all whitespace, comments, processing instructions, and declarations\nseen in the internal subset. The declarations will be there whether or not they have been\nprocessed by another handler (except for unparsed entities processed by the Unparsed\nhandler). However, comments and processing instructions will not appear if they've been\nprocessed by their respective handlers.\n\nxmldecl\nReceive notification of an XML declaration event.\n\nVersion          The version.\nEncoding         The encoding string, if any.\nStandalone       True, false, or undefined if not declared.\n"
                },
                {
                    "name": "EntityResolver",
                    "content": "resolveentity\nAllow the handler to resolve external entities.\n\nName             The notation name.\nSystemId         The notation's system identifier.\nPublicId         The notation's public identifier, if any.\nBase             The base for resolving a relative URI, if any.\n\n`\"resolveentity()\"' should return undef to request that the parser open a regular URI\nconnection to the system identifier or a hash describing the new input source. This hash has\nthe same properties as the `\"Source\"' parameter to `\"parse()\"':\n\nPublicId    The public identifier of the external entity being\nreferenced, or undef if none was supplied.\nSystemId    The system identifier of the external entity being\nreferenced.\nString      String containing XML text\nByteStream  An open file handle.\nCharacterStream\nAn open file handle.\nEncoding    The character encoding, if known.\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "Ken MacLeod, ken@bitsko.slc.ut.us\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "",
            "subsections": [
                {
                    "name": "perl",
                    "content": "Extensible Markup Language (XML) <http://www.w3c.org/XML/>\nSAX 1.0: The Simple API for XML <http://www.megginson.com/SAX/>\n"
                }
            ]
        }
    },
    "summary": "XML::Parser::PerlSAX - Perl SAX parser using XML::Parser",
    "flags": [],
    "examples": [],
    "see_also": []
}