{
    "content": [
        {
            "type": "text",
            "text": "# XML::Grove::Sub (perldoc)\n\n## NAME\n\nXML::Grove::Sub - run a filter sub over a grove\n\n## SYNOPSIS\n\nuse XML::Grove::Sub;\n# Using filter method on XML::Grove::Document or XML::Grove::Element:\n@results = $groveobject->filter(\\&sub [, ...]);\n# Using an XML::Grove::Sub instance:\n$filterer = XML::Grove::Sub->new();\n@results = $groveobject->accept($filterer, \\&sub [, ...]);\n\n## DESCRIPTION\n\n\"XML::Grove::Sub\" executes a sub, the filter, over all objects in a grove and returns a list of\nall the return values from the sub. The sub is called with the grove object as it's first\nparameter and passing the rest of the arguments to the call to `\"filter()\"' or `\"accept()\"'.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXAMPLE**\n- **AUTHOR**\n- **SEE ALSO** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "XML::Grove::Sub",
        "section": "",
        "mode": "perldoc",
        "summary": "XML::Grove::Sub - run a filter sub over a grove",
        "synopsis": "use XML::Grove::Sub;\n# Using filter method on XML::Grove::Document or XML::Grove::Element:\n@results = $groveobject->filter(\\&sub [, ...]);\n# Using an XML::Grove::Sub instance:\n$filterer = XML::Grove::Sub->new();\n@results = $groveobject->accept($filterer, \\&sub [, ...]);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "The following filter will return a list of all `\"foo\"' or `\"bar\"' elements with an attribute",
            "`\"widget-no\"' beginning with `\"A\"' or `\"B\"'.",
            "@results = $groveobj->filter(sub {",
            "my $obj = shift;",
            "if ($obj->isa('XML::Grove::Element')",
            "&& (($obj->{Name} eq 'foo')",
            "|| ($obj->{Name} eq 'bar'))",
            "&& ($obj->{Attributes}{'widget-no'} =~ /^[AB]/)) {",
            "return ($obj);",
            "return ();",
            "});"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 1,
                "subsections": [
                    {
                        "name": "perl",
                        "lines": 2
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "XML::Grove::Sub - run a filter sub over a grove\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use XML::Grove::Sub;\n\n# Using filter method on XML::Grove::Document or XML::Grove::Element:\n@results = $groveobject->filter(\\&sub [, ...]);\n\n# Using an XML::Grove::Sub instance:\n$filterer = XML::Grove::Sub->new();\n@results = $groveobject->accept($filterer, \\&sub [, ...]);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"XML::Grove::Sub\" executes a sub, the filter, over all objects in a grove and returns a list of\nall the return values from the sub. The sub is called with the grove object as it's first\nparameter and passing the rest of the arguments to the call to `\"filter()\"' or `\"accept()\"'.\n",
                "subsections": []
            },
            "EXAMPLE": {
                "content": "The following filter will return a list of all `\"foo\"' or `\"bar\"' elements with an attribute\n`\"widget-no\"' beginning with `\"A\"' or `\"B\"'.\n\n@results = $groveobj->filter(sub {\nmy $obj = shift;\n\nif ($obj->isa('XML::Grove::Element')\n&& (($obj->{Name} eq 'foo')\n|| ($obj->{Name} eq 'bar'))\n&& ($obj->{Attributes}{'widget-no'} =~ /^[AB]/)) {\nreturn ($obj);\n}\nreturn ();\n});\n",
                "subsections": []
            },
            "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>\n"
                    }
                ]
            }
        }
    }
}