{
    "mode": "perldoc",
    "parameter": "XML::Generator::DOM",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AGenerator%3A%3ADOM/json",
    "generated": "2026-06-13T06:26:06Z",
    "synopsis": "use XML::Generator::DOM;\nmy $dg  = XML::Generator::DOM->new();\nmy $doc = $dg->xml($dg->xmlcmnt(\"Test document.\"),\n$dg->foo({'baz' => 'bam'}, 42));\nprint $doc->toString;\nyields:\n<?xml version=\"1.0\" standalone=\"yes\"?>\n<!--Test document-->\n<foo baz=\"bam\">42</foo>",
    "sections": {
        "NAME": {
            "content": "XML::Generator::DOM - XML::Generator subclass for producing DOM trees instead of strings.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::Generator::DOM;\n\nmy $dg  = XML::Generator::DOM->new();\nmy $doc = $dg->xml($dg->xmlcmnt(\"Test document.\"),\n$dg->foo({'baz' => 'bam'}, 42));\nprint $doc->toString;\n\nyields:\n\n<?xml version=\"1.0\" standalone=\"yes\"?>\n<!--Test document-->\n<foo baz=\"bam\">42</foo>\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "XML::Generator::DOM subclasses XML::Generator in order to produce DOM trees instead of strings\n(see XML::Generator and XML::DOM). This module is still experimental and its semantics might\nchange.\n\nEssentially, tag methods return XML::DOM::DocumentFragment objects, constructed either from a\nDOM document passed into the constructor or a default document that XML::Generator::DOM will\nautomatically construct.\n\nCalling the xml() method will return this automatically constructed document and cause a fresh\none to be constructed for future tag method calls. If you passed in your own document, you may\nnot call the xml() method.\n\nBelow, we just note the remaining differences in semantics between XML::Generator methods and\nXML::Generator::DOM methods.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This library is free software, you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        },
        "CONSTRUCTOR": {
            "content": "These configuration options are accepted but have no effect on the semantics of the returned\nobject: escape, pretty, conformance and empty.\n",
            "subsections": []
        },
        "TAG METHODS": {
            "content": "Subsequently, tag method semantics are somewhat different for this module compared to\nXML::Generator. The primary difference is that tag method return XML::DOM::DocumentFragment\nobjects. Namespace and attribute processing remains the same, but remaining arguments to tag\nmethods must either be text or other XML::DOM::DocumentFragment objects. No escape processing,\nsyntax checking, or output control is done; this is all left up to XML::DOM.\n",
            "subsections": []
        },
        "SPECIAL TAGS": {
            "content": "All special tags are available by default with XML::Generator::DOM; you don't need to use\n'conformance' => 'strict'.\n\nxmlpi(@args)\nArguments will simply be concatenated and passed as the data to the\nXML::DOM::ProcessingInstruction object that is returned.\n\nxmlcmnt\nEscaping of '--' is done by XML::DOM::Comment, which replaces both hyphens with '&#45;'. An\nXML::DOM::Comment object is returned.\n\nxmldecl\nReturns an XML::DOM::XMLDecl object. Respects 'version', 'encoding' and 'dtd' settings in the\nobject.\n\nxmldecl\nReturns an XML::DOM::DocumentType object.\n\nxmlcdata\nReturns an XML::DOM::CDATASection object.\n\nxml\nAs described above, xml() can only be used when domdocument was not set in the object. The\nautomatically created document will have its XML Declaration set and the arguments to xml() will\nbe appended to it. Then a new DOM document is automatically generated and the old one is\nreturned. This is the only way to get a DOM document from this module.\n",
            "subsections": []
        }
    },
    "summary": "XML::Generator::DOM - XML::Generator subclass for producing DOM trees instead of strings.",
    "flags": [],
    "examples": [],
    "see_also": []
}