An xml document node in xml::dom
XML::DOM::Document extends XML::DOM::Node.
It is the main root of the \s-1XML\s0 document structure as returned by XML::DOM::Parser::parse and XML::DOM::Parser::parsefile.
Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the Document interface also contains the factory methods needed to create these objects. The Node objects created have a getOwnerDocument method which associates them with the Document within whose context they were created.
\$1
This is a convenience method that allows direct access to the child node that is the root Element of the document.
The Document Type Declaration (see DocumentType) associated with this document. For \s-1HTML\s0 documents as well as \s-1XML\s0 documents without a document type declaration this returns undef. The \s-1DOM\s0 Level 1 does not support editing the Document Type Declaration. Not In \s-1DOM\s0 Spec: This implementation allows editing the doctype. See XML::DOM::ignoreReadOnly for details.
The DOMImplementation object that handles this document. A \s-1DOM\s0 application may use objects from multiple implementations.
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object. DOMExceptions:
Raised if the tagName does not conform to the \s-1XML\s0 spec.
Creates a Text node given the specified string.
Creates a Comment node given the specified string.
Creates a CDATASection node given the specified string.
Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttribute method. Not In \s-1DOM\s0 Spec: The \s-1DOM\s0 Spec does not allow passing the value or the specified property in this method. In this implementation they are optional. Parameters: value The attribute's value. See Attr::setValue for details.
If the value is not supplied, the specified property is set to 0.
specified Whether the attribute value was specified or whether the default
value was used. If not supplied, it's assumed to be 1.
DOMExceptions:
Raised if the name does not conform to the \s-1XML\s0 spec.
Creates a ProcessingInstruction node given the specified name and data strings. Parameters: target The target part of the processing instruction. data The data for the node. DOMExceptions:
Raised if the target does not conform to the \s-1XML\s0 spec.
Creates an empty DocumentFragment object.
Creates an EntityReference object.
Returns the XMLDecl for this Document or undef if none was specified. Note that XMLDecl is not part of the list of child nodes.
Sets or replaces the DocumentType. \s-1NOTE\s0: Don't use appendChild or insertBefore to set the DocumentType. Even though doctype will be part of the list of child nodes, it is handled specially.
Returns the default attribute value as a string or undef, if none is available. Parameters: elem The element tagName. attr The attribute name.
Returns the Entity with the specified name.
Creates an XMLDecl object. All parameters may be undefined.
Creates a DocumentType object. SysId and pubId may be undefined.
Creates a new Notation object. Consider using XML::DOM::DocumentType::addNotation!
Creates an Entity object. Consider using XML::DOM::DocumentType::addEntity!
Creates an ElementDecl object. DOMExceptions:
Raised if the element name (tagName) does not conform to the \s-1XML\s0 spec.
Creates an AttlistDecl object. DOMExceptions:
Raised if the element name (tagName) does not conform to the \s-1XML\s0 spec.
Expands the specified entity or parameter entity (if parameter=1) and returns its value as a string, or undef if the entity does not exist. (The entity name should not contain the '%', '&' or ';' delimiters.)
Uses the specified XML::Checker to validate the document. If no XML::Checker is supplied, a new XML::Checker is created. See XML::Checker for details.
Similar to check() except it uses the \s-1SAX\s0 interface to XML::Checker instead of the expat interface. This method may disappear or replace check() at some time.
Creates an XML::Checker based on the document's \s-1DTD\s0. The $checker can be reused to check any elements within the document. Create a new XML::Checker whenever the \s-1DOCTYPE\s0 section of the document is altered!