{
    "mode": "perldoc",
    "parameter": "XML::Parser::Style::Stream",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AParser%3A%3AStyle%3A%3AStream/json",
    "generated": "2026-06-13T19:07:46Z",
    "synopsis": "use XML::Parser;\nmy $p = XML::Parser->new(Style => 'Stream', Pkg => 'MySubs');\n$p->parsefile('foo.xml');\n{\npackage MySubs;\nsub StartTag {\nmy ($e, $name) = @;\n# do something with start tags\n}\nsub EndTag {\nmy ($e, $name) = @;\n# do something with end tags\n}\nsub Characters {\nmy ($e, $data) = @;\n# do something with text nodes\n}\n}",
    "sections": {
        "NAME": {
            "content": "XML::Parser::Style::Stream - Stream style for XML::Parser\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::Parser;\nmy $p = XML::Parser->new(Style => 'Stream', Pkg => 'MySubs');\n$p->parsefile('foo.xml');\n\n{\npackage MySubs;\n\nsub StartTag {\nmy ($e, $name) = @;\n# do something with start tags\n}\n\nsub EndTag {\nmy ($e, $name) = @;\n# do something with end tags\n}\n\nsub Characters {\nmy ($e, $data) = @;\n# do something with text nodes\n}\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This style uses the Pkg option to find subs in a given package to call for each event. If none\nof the subs that this style looks for is there, then the effect of parsing with this style is to\nprint a canonical copy of the document without comments or declarations. All the subs receive as\ntheir 1st parameter the Expat instance for the document they're parsing.\n\nIt looks for the following routines:\n\n*   StartDocument\n\nCalled at the start of the parse .\n\n*   StartTag\n\nCalled for every start tag with a second parameter of the element type. The $ variable will\ncontain a copy of the tag and the % variable will contain attribute values supplied for\nthat element.\n\n*   EndTag\n\nCalled for every end tag with a second parameter of the element type. The $ variable will\ncontain a copy of the end tag.\n\n*   Text\n\nCalled just before start or end tags with accumulated non-markup text in the $ variable.\n\n*   PI\n\nCalled for processing instructions. The $ variable will contain a copy of the PI and the\ntarget and data are sent as 2nd and 3rd parameters respectively.\n\n*   EndDocument\n\nCalled at conclusion of the parse.\n",
            "subsections": []
        }
    },
    "summary": "XML::Parser::Style::Stream - Stream style for XML::Parser",
    "flags": [],
    "examples": [],
    "see_also": []
}