{
    "content": [
        {
            "type": "text",
            "text": "# XML::DOM::DocumentType (perldoc)\n\n## NAME\n\nXML::DOM::DocumentType - An XML document type (DTD) in XML::DOM\n\n## DESCRIPTION\n\nXML::DOM::DocumentType extends XML::DOM::Node.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "XML::DOM::DocumentType",
        "section": "",
        "mode": "perldoc",
        "summary": "XML::DOM::DocumentType - An XML document type (DTD) in XML::DOM",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 43,
                "subsections": [
                    {
                        "name": "Additional methods not in the DOM Spec",
                        "lines": 84
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "XML::DOM::DocumentType - An XML document type (DTD) in XML::DOM\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "XML::DOM::DocumentType extends XML::DOM::Node.\n\nEach Document has a doctype attribute whose value is either null or a DocumentType object. The\nDocumentType interface in the DOM Level 1 Core provides an interface to the list of entities\nthat are defined for the document, and little else because the effect of namespaces and the\nvarious XML scheme efforts on DTD representation are not clearly understood as of this writing.\nThe DOM Level 1 doesn't support editing DocumentType nodes.\n\nNot In DOM Spec: This implementation has added a lot of extra functionality to the DOM Level 1\ninterface. To allow editing of the DocumentType nodes, see XML::DOM::ignoreReadOnly.\n\nMETHODS\ngetName\nReturns the name of the DTD, i.e. the name immediately following the DOCTYPE keyword.\n\ngetEntities\nA NamedNodeMap containing the general entities, both external and internal, declared in the\nDTD. Duplicates are discarded. For example in:\n\n<!DOCTYPE ex SYSTEM \"ex.dtd\" [\n<!ENTITY foo \"foo\">\n<!ENTITY bar \"bar\">\n<!ENTITY % baz \"baz\">\n]>\n<ex/>\n\nthe interface provides access to foo and bar but not baz. Every node in this map also\nimplements the Entity interface.\n\nThe DOM Level 1 does not support editing entities, therefore entities cannot be altered in\nany way.\n\nNot In DOM Spec: See XML::DOM::ignoreReadOnly to edit the DocumentType etc.\n\ngetNotations\nA NamedNodeMap containing the notations declared in the DTD. Duplicates are discarded. Every\nnode in this map also implements the Notation interface.\n\nThe DOM Level 1 does not support editing notations, therefore notations cannot be altered in\nany way.\n\nNot In DOM Spec: See XML::DOM::ignoreReadOnly to edit the DocumentType etc.\n",
                "subsections": [
                    {
                        "name": "Additional methods not in the DOM Spec",
                        "content": "Creating and setting the DocumentType\nA new DocumentType can be created with:\n\n$doctype = $doc->createDocumentType ($name, $sysId, $pubId, $internal);\n\nTo set (or replace) the DocumentType for a particular document, use:\n\n$doc->setDocType ($doctype);\n\ngetSysId and setSysId (sysId)\nReturns or sets the system id.\n\ngetPubId and setPubId (pudId)\nReturns or sets the public id.\n\nsetName (name)\nSets the name of the DTD, i.e. the name immediately following the DOCTYPE keyword. Note that\nthis should always be the same as the element tag name of the root element.\n\ngetAttlistDecl (elemName)\nReturns the AttlistDecl for the Element with the specified name, or undef.\n\ngetElementDecl (elemName)\nReturns the ElementDecl for the Element with the specified name, or undef.\n\ngetEntity (entityName)\nReturns the Entity with the specified name, or undef.\n\naddAttlistDecl (elemName)\nAdds a new AttDecl node with the specified elemName if one doesn't exist yet. Returns the\nAttlistDecl (new or existing) node.\n\naddElementDecl (elemName, model)\nAdds a new ElementDecl node with the specified elemName and model if one doesn't exist yet.\nReturns the AttlistDecl (new or existing) node. The model is ignored if one already existed.\n\naddEntity (notationName, value, sysId, pubId, ndata, parameter)\nAdds a new Entity node. Don't use createEntity and appendChild, because it should be added\nto the internal NamedNodeMap containing the entities.\n\nParameters: *notationName* the entity name. *value* the entity value. *sysId* the system id\n(if any.) *pubId* the public id (if any.) *ndata* the NDATA declaration (if any, for general\nunparsed entities.) *parameter* whether it is a parameter entity (%ent;) or not (&ent;).\n\nSysId, pubId and ndata may be undefined.\n\nDOMExceptions:\n\n*   INVALIDCHARACTERERR\n\nRaised if the notationName does not conform to the XML spec.\n\naddNotation (name, base, sysId, pubId)\nAdds a new Notation object.\n\nParameters: *name* the notation name. *base* the base to be used for resolving a relative\nURI. *sysId* the system id. *pubId* the public id.\n\nBase, sysId, and pubId may all be undefined. (These parameters are passed by the XML::Parser\nNotation handler.)\n\nDOMExceptions:\n\n*   INVALIDCHARACTERERR\n\nRaised if the notationName does not conform to the XML spec.\n\naddAttDef (elemName, attrName, type, default, fixed)\nAdds a new attribute definition. It will add the AttDef node to the AttlistDecl if it\nexists. If an AttDef with the specified attrName already exists for the given elemName, this\nfunction only generates a warning.\n\nSee XML::DOM::AttDef::new for the other parameters.\n\ngetDefaultAttrValue (elem, attr)\nReturns the default attribute value as a string or undef, if none is available.\n\nParameters: *elem* The element tagName. *attr* The attribute name.\n\nexpandEntity (entity [, parameter])\nExpands the specified entity or parameter entity (if parameter=1) and returns its value as a\nstring, or undef if the entity does not exist. (The entity name should not contain the '%',\n'&' or ';' delimiters.)\n"
                    }
                ]
            }
        }
    }
}