XML::DOM::DocumentType



XML::DOM::DocumentType

NAME
DESCRIPTION
POD ERRORS

NAME

XML::DOM::DocumentType − An XML document type (DTD) in XML::DOM

DESCRIPTION

XML::DOM::DocumentType extends XML::DOM::Node.

Each Document has a doctype attribute whose value is either null or a DocumentType object. The DocumentType interface in the DOM Level 1 Core provides an interface to the list of entities that are defined for the document, and little else because the effect of namespaces and the various XML scheme efforts on DTD representation are not clearly understood as of this writing. The DOM Level 1 doesn’t support editing DocumentType nodes.

Not In DOM Spec: This implementation has added a lot of extra functionality to the DOM Level 1 interface. To allow editing of the DocumentType nodes, see XML::DOM::ignoreReadOnly.

METHODS
getName

Returns the name of the DTD , i.e. the name immediately following the DOCTYPE keyword.

getEntities

A NamedNodeMap containing the general entities, both external and internal, declared in the DTD . Duplicates are discarded. For example in:

 <!DOCTYPE ex SYSTEM "ex.dtd" [
  <!ENTITY foo "foo">
  <!ENTITY bar "bar">
  <!ENTITY % baz "baz">
 ]>
 <ex/>

the interface provides access to foo and bar but not baz. Every node in this map also implements the Entity interface.

The DOM Level 1 does not support editing entities, therefore entities cannot be altered in any way.

Not In DOM Spec: See XML::DOM::ignoreReadOnly to edit the DocumentType etc.

getNotations

A NamedNodeMap containing the notations declared in the DTD . Duplicates are discarded. Every node in this map also implements the Notation interface.

The DOM Level 1 does not support editing notations, therefore notations cannot be altered in any way.

Not In DOM Spec: See XML::DOM::ignoreReadOnly to edit the DocumentType etc.

Additional methods not in the DOM Spec
Creating and setting the DocumentType

A new DocumentType can be created with:

        $doctype = $doc−>createDocumentType ($name, $sysId, $pubId, $internal);

To set (or replace) the DocumentType for a particular document, use:

        $doc−>setDocType ($doctype);

getSysId and setSysId (sysId)

Returns or sets the system id.

getPubId and setPubId (pudId)

Returns or sets the public id.

setName (name)

Sets the name of the DTD , i.e. the name immediately following the DOCTYPE keyword. Note that this should always be the same as the element tag name of the root element.

getAttlistDecl (elemName)

Returns the AttlistDecl for the Element with the specified name, or undef.

getElementDecl (elemName)

Returns the ElementDecl for the Element with the specified name, or undef.

getEntity (entityName)

Returns the Entity with the specified name, or undef.

addAttlistDecl (elemName)

Adds a new AttDecl node with the specified elemName if one doesn’t exist yet. Returns the AttlistDecl (new or existing) node.

addElementDecl (elemName, model)

Adds a new ElementDecl node with the specified elemName and model if one doesn’t exist yet. Returns the AttlistDecl (new or existing) node. The model is ignored if one already existed.

addEntity (notationName, value, sysId, pubId, ndata, parameter)

Adds a new Entity node. Don’t use createEntity and appendChild, because it should be added to the internal NamedNodeMap containing the entities.

Parameters:
notationName
the entity name.
value
the entity value.
sysId
the system id (if any.)
pubId
the public id (if any.)
ndata
the NDATA declaration (if any, for general unparsed entities.)
parameter
whether it is a parameter entity (%ent;) or not (&ent;).

SysId, pubId and ndata may be undefined.

DOMExceptions:

INVALID_CHARACTER_ERR

Raised if the notationName does not conform to the XML spec.

addNotation (name, base, sysId, pubId)

Adds a new Notation object.

Parameters:
name
the notation name.
base
the base to be used for resolving a relative URI .
sysId
the system id.
pubId
the public id.

Base, sysId, and pubId may all be undefined. (These parameters are passed by the XML::Parser Notation handler.)

DOMExceptions:

INVALID_CHARACTER_ERR

Raised if the notationName does not conform to the XML spec.

addAttDef (elemName, attrName, type, default, fixed)

Adds a new attribute definition. It will add the AttDef node to the AttlistDecl if it exists. If an AttDef with the specified attrName already exists for the given elemName, this function only generates a warning.

See XML::DOM::AttDef::new for the other parameters.

getDefaultAttrValue (elem, attr)

Returns the default attribute value as a string or undef, if none is available.

Parameters:
elem
The element tagName.
attr
The attribute name.

expandEntity (entity [, parameter])

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.)

POD ERRORS

Hey! The above document had some coding errors, which are explained below:
Around line 62:

You forgot a ’=back’ before ’=head2’

Around line 64:

’=item’ outside of any ’=over’






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.