{
    "content": [
        {
            "type": "text",
            "text": "# XML::Parser::LiteCopy (perldoc)\n\n## NAME\n\nXML::Parser::LiteCopy - Lightweight regexp-based XML parser\n\n## SYNOPSIS\n\nuse XML::Parser::LiteCopy;\n$p1 = new XML::Parser::LiteCopy;\n$p1->setHandlers(\nStart => sub { shift; print \"start: @\\n\" },\nChar => sub { shift; print \"char: @\\n\" },\nEnd => sub { shift; print \"end: @\\n\" },\n);\n$p1->parse('<foo id=\"me\">Hello World!</foo>');\n$p2 = new XML::Parser::LiteCopy\nHandlers => {\nStart => sub { shift; print \"start: @\\n\" },\nChar => sub { shift; print \"char: @\\n\" },\nEnd => sub { shift; print \"end: @\\n\" },\n}\n;\n$p2->parse('<foo id=\"me\">Hello <bar>cruel</bar> World!</foo>');\n\n## DESCRIPTION\n\nThis Perl implements an XML parser with a interface similar to XML::Parser. Though not all\ncallbacks are supported, you should be able to use it in the same way you use XML::Parser. Due\nto using experimantal regexp features it'll work only on Perl 5.6 and above and may behave\ndifferently on different platforms.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SUBROUTINES/METHODS**\n- **Handler methods** (7 subsections)\n- **SEE ALSO**\n- **COPYRIGHT**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "XML::Parser::LiteCopy",
        "section": "",
        "mode": "perldoc",
        "summary": "XML::Parser::LiteCopy - Lightweight regexp-based XML parser",
        "synopsis": "use XML::Parser::LiteCopy;\n$p1 = new XML::Parser::LiteCopy;\n$p1->setHandlers(\nStart => sub { shift; print \"start: @\\n\" },\nChar => sub { shift; print \"char: @\\n\" },\nEnd => sub { shift; print \"end: @\\n\" },\n);\n$p1->parse('<foo id=\"me\">Hello World!</foo>');\n$p2 = new XML::Parser::LiteCopy\nHandlers => {\nStart => sub { shift; print \"start: @\\n\" },\nChar => sub { shift; print \"char: @\\n\" },\nEnd => sub { shift; print \"end: @\\n\" },\n}\n;\n$p2->parse('<foo id=\"me\">Hello <bar>cruel</bar> World!</foo>');",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SUBROUTINES/METHODS",
                "lines": 44,
                "subsections": []
            },
            {
                "name": "Handler methods",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Init",
                        "lines": 2
                    },
                    {
                        "name": "Start",
                        "lines": 2
                    },
                    {
                        "name": "Char",
                        "lines": 4
                    },
                    {
                        "name": "End",
                        "lines": 2
                    },
                    {
                        "name": "Comment",
                        "lines": 5
                    },
                    {
                        "name": "Doctype",
                        "lines": 2
                    },
                    {
                        "name": "Final",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "XML::Parser::LiteCopy - Lightweight regexp-based XML parser\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use XML::Parser::LiteCopy;\n\n$p1 = new XML::Parser::LiteCopy;\n$p1->setHandlers(\nStart => sub { shift; print \"start: @\\n\" },\nChar => sub { shift; print \"char: @\\n\" },\nEnd => sub { shift; print \"end: @\\n\" },\n);\n$p1->parse('<foo id=\"me\">Hello World!</foo>');\n\n$p2 = new XML::Parser::LiteCopy\nHandlers => {\nStart => sub { shift; print \"start: @\\n\" },\nChar => sub { shift; print \"char: @\\n\" },\nEnd => sub { shift; print \"end: @\\n\" },\n}\n;\n$p2->parse('<foo id=\"me\">Hello <bar>cruel</bar> World!</foo>');\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This Perl implements an XML parser with a interface similar to XML::Parser. Though not all\ncallbacks are supported, you should be able to use it in the same way you use XML::Parser. Due\nto using experimantal regexp features it'll work only on Perl 5.6 and above and may behave\ndifferently on different platforms.\n\nNote that you cannot use regular expressions or split in callbacks. This is due to a limitation\nof perl's regular expression implementation (which is not re-entrant).\n",
                "subsections": []
            },
            "SUBROUTINES/METHODS": {
                "content": "new\nConstructor.\n\nAs (almost) all SOAP::Lite constructors, new() returns the object called on when called as\nobject method. This means that the following effectifely is a no-op if $obj is a object:\n\n$obj = $obj->new();\n\nNew accepts a single named parameter, \"Handlers\" with a hash ref as value:\n\nmy $parser = XML::Parser::Lite->new(\nHandlers => {\nStart => sub { shift; print \"start: @\\n\" },\nChar => sub { shift; print \"char: @\\n\" },\nEnd => sub { shift; print \"end: @\\n\" },\n}\n);\n\nThe handlers given will be passed to setHandlers.\n\nsetHandlers\nSets (or resets) the parsing handlers. Accepts a hash with the handler names and handler code\nreferences as parameters. Passing \"undef\" instead of a code reference replaces the handler by a\nno-op.\n\nThe following handlers can be set:\n\nInit\nStart\nChar\nEnd\nFinal\nCData\nDoctype\nComment\nPI\n\nAll other handlers are ignored.\n\nCalling setHandlers without parameters resets all handlers to no-ops.\n\nparse\nParses the XML given. In contrast to XML::Parser's parse method, parse() only parses strings.\n",
                "subsections": []
            },
            "Handler methods": {
                "content": "",
                "subsections": [
                    {
                        "name": "Init",
                        "content": "Called before parsing starts. You should perform any necessary initializations in Init.\n"
                    },
                    {
                        "name": "Start",
                        "content": "Called at the start of each XML node. See XML::Parser for details.\n"
                    },
                    {
                        "name": "Char",
                        "content": "Called for each character sequence. May be called multiple times for the characters contained in\nan XML node (even for every single character). Your implementation has to make sure that it\ncaptures all characters.\n"
                    },
                    {
                        "name": "End",
                        "content": "Called at the end of each XML node. See XML::Parser for details\n"
                    },
                    {
                        "name": "Comment",
                        "content": "See XML::Parser for details\n\nPI\nSee XMLDecl in XML::Parser for details, but also includes other processing instructions\n"
                    },
                    {
                        "name": "Doctype",
                        "content": "See XML::Parser for details\n"
                    },
                    {
                        "name": "Final",
                        "content": "Called at the end of the parsing process. You should perform any necessary cleanup here.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "XML::Parser\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (C) 2000-2007 Paul Kulchenko. All rights reserved.\n\nCopyright (C) 2008 Martin Kutter. All rights reserved.\n\nCopyright (C) 2009 Cal Henderson. All rights reserved.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nThis parser is based on \"shallow parser\" http://www.cs.sfu.ca/~cameron/REX.html Copyright (c)\n1998, Robert D. Cameron.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Paul Kulchenko (paulclinger@yahoo.com)\n\nMartin Kutter (martin.kutter@fen-net.de)\n\nAdditional handlers supplied by Adam Leggett.\n\nFurther modifications by Cal Henderson.\n",
                "subsections": []
            }
        }
    }
}