{
    "mode": "perldoc",
    "parameter": "XML::LibXML::PI",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ALibXML%3A%3API/json",
    "generated": "2026-06-09T20:59:11Z",
    "synopsis": "use XML::LibXML;\n# Only methods specific to Processing Instruction nodes are listed here,\n# see the XML::LibXML::Node manpage for other methods\n$pinode->setData( $datastring );\n$pinode->setData( name=>stringvalue [...] );",
    "sections": {
        "NAME": {
            "content": "XML::LibXML::PI - XML::LibXML Processing Instructions\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::LibXML;\n# Only methods specific to Processing Instruction nodes are listed here,\n# see the XML::LibXML::Node manpage for other methods\n\n$pinode->setData( $datastring );\n$pinode->setData( name=>stringvalue [...] );\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Processing instructions are implemented with XML::LibXML with read and write access. The PI data\nis the PI without the PI target (as specified in XML 1.0 [17]) as a string. This string can be\naccessed with getData as implemented in XML::LibXML::Node.\n\nThe write access is aware about the fact, that many processing instructions have attribute like\ndata. Therefore setData() provides besides the DOM spec conform Interface to pass a set of named\nparameter. So the code segment\n\nmy $pi = $dom->createProcessingInstruction(\"abc\");\n$pi->setData(foo=>'bar', foobar=>'foobar');\n$dom->appendChild( $pi );\n\nwill result the following PI in the DOM:\n\n<?abc foo=\"bar\" foobar=\"foobar\"?>\n\nWhich is how it is specified in the DOM specification. This three step interface creates\ntemporary a node in perl space. This can be avoided while using the",
            "subsections": [
                {
                    "name": "insertProcessingInstruction",
                    "content": "$dom->insertProcessingInstruction(\"abc\",'foo=\"bar\" foobar=\"foobar\"');\n\nwill have the same result as above.\n\nXML::LibXML::PI's implementation of setData() documented below differs a bit from the standard\nversion as available in XML::LibXML::Node:\n\nsetData\n$pinode->setData( $datastring );\n$pinode->setData( name=>stringvalue [...] );\n\nThis method allows one to change the content data of a PI. Additionally to the interface\nspecified for DOM Level2, the method provides a named parameter interface to set the data.\nThis parameter list is converted into a string before it is appended to the PI.\n"
                }
            ]
        },
        "AUTHORS": {
            "content": "Matt Sergeant, Christian Glahn, Petr Pajas\n",
            "subsections": []
        },
        "VERSION": {
            "content": "2.0134\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "2001-2007, AxKit.com Ltd.\n\n2002-2006, Christian Glahn.\n\n2006-2009, Petr Pajas.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "XML::LibXML::PI - XML::LibXML Processing Instructions",
    "flags": [],
    "examples": [],
    "see_also": []
}