{
    "mode": "perldoc",
    "parameter": "XML::SAX2Perl",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ASAX2Perl/json",
    "generated": "2026-06-12T22:27:24Z",
    "synopsis": "use XML::SAX2Perl;\n$sax2perl = XML::SAX2Perl(Handler => $myhandler);\n$sax->setDocumentHandler($sax2perl);",
    "sections": {
        "NAME": {
            "content": "XML::SAX2Perl -- translate Java/CORBA style SAX methods to Perl methods\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::SAX2Perl;\n\n$sax2perl = XML::SAX2Perl(Handler => $myhandler);\n$sax->setDocumentHandler($sax2perl);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"XML::SAX2Perl\" is a SAX filter that translates Java/CORBA style SAX methods to Perl style\nmethod calls. This man page summarizes the specific options, handlers, and properties supported\nby \"XML::SAX2Perl\"; please refer to the Perl SAX standard \"XML::SAX\" for general usage\ninformation.\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.\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.\n\nSAX DocumentHandler Methods\nThe following methods are DocumentHandler methods that the SAX 1.0 parser will call and\n\"XML::SAX2Perl\" will translate to Perl SAX methods calls. See SAX 1.0 for details.\n\nsetDocumentLocator(locator)\nstartDocument()\nendDocument()\nstartElement(name, atts)\nendElement(name)\ncharacters(ch, start, length)\nignorableWhitespace(ch, start, length)\nprocessingInstruction(target, data)\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The following options are supported by \"XML::SAX2Perl\":\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\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::SAX2Perl\":\n",
            "subsections": [
                {
                    "name": "DocumentHandler methods",
                    "content": "startdocument\nReceive notification of the beginning of a document.\n\nLocator          An object that can return the location of any SAX\ndocument event.\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       Attributes attached to the element, if any.\n\nALPHA WARNING: The `\"Attributes\"' value is not translated from the SAX 1.0 value, so it will\ncontain an AttributeList object.\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\nignorablewhitespace\nReceive notification of ignorable whitespace in element content.\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"
                }
            ]
        },
        "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/>\nSimple API for XML (SAX) <http://www.megginson.com/SAX/>\n"
                }
            ]
        }
    },
    "summary": "XML::SAX2Perl -- translate Java/CORBA style SAX methods to Perl methods",
    "flags": [],
    "examples": [],
    "see_also": []
}