{
    "mode": "perldoc",
    "parameter": "XML::Parser::Style::Tree",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AParser%3A%3AStyle%3A%3ATree/json",
    "generated": "2026-07-05T09:33:26Z",
    "synopsis": "use XML::Parser;\nmy $p = XML::Parser->new(Style => 'Tree');\nmy $tree = $p->parsefile('foo.xml');",
    "sections": {
        "NAME": {
            "content": "XML::Parser::Style::Tree - Tree style parser\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::Parser;\nmy $p = XML::Parser->new(Style => 'Tree');\nmy $tree = $p->parsefile('foo.xml');\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module implements XML::Parser's Tree style parser.\n\nWhen parsing a document, \"parse()\" will return a parse tree for the document. Each node in the\ntree takes the form of a tag, content pair. Text nodes are represented with a pseudo-tag of \"0\"\nand the string that is their content. For elements, the content is an array reference. The first\nitem in the array is a (possibly empty) hash reference containing attributes. The remainder of\nthe array is a sequence of tag-content pairs representing the content of the element.\n\nSo for example the result of parsing:\n\n<foo><head id=\"a\">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo>\n\nwould be: Tag Content ================================================================== [foo,\n[{}, head, [{id => \"a\"}, 0, \"Hello \", em, [{}, 0, \"there\"]], bar, [ {}, 0, \"Howdy\", ref, [{}]],\n0, \"do\" ] ]\n\nThe root document \"foo\", has 3 children: a \"head\" element, a \"bar\" element and the text \"do\".\nAfter the empty attribute hash, these are represented in it's contents by 3 tag-content pairs.\n",
            "subsections": []
        }
    },
    "summary": "XML::Parser::Style::Tree - Tree style parser",
    "flags": [],
    "examples": [],
    "see_also": []
}