|o||methods or objects to build / traverse the DTD|
new $doctype = XML::Doctype->new() ; $doctype = XML::Doctype->new( FooML, DTD_TEXT => $doctype_text ) ; $doctype = XML::Doctype->new( FooML, SYSTEM_ID => FooML.dtd ) ; name $name = $doctype->name() ; Sets/gets the name. parse_dtd $doctype->parse_dtd( $name, $doctype_text ) ; $doctype->parse_dtd( $name, $doctype_text, internal ) ;
Parses the text of a DTD from a scalar. $name is used to indicate the name of the DOCTYPE, and thus the root node.
The DTD is considered to be external unless the third parameter is TRUE.
parse_dtd_file $doctype->parse_dtd_file( $name, $system_id [, $public_id] ) ; $doctype->parse_dtd_file( $name, $system_id [, $public_id], internal ) ;
Parses a DTD from a file. Eventually will support full URL syntax.
$public_id is ignored for now, and $system_id is used to locate the DTD.
The DTD is considered to be external unless the fourth parameter is TRUE.
$doctype->parse_dtd_file( $name, $system_id, $p_id, internal ) ; $doctype->parse_dtd_file( $name, $system_id, undef, internal ) ;
system_id $system_id = $doctype->system_id() ; Sets/gets the system ID. public_id $public_id = $doctype->public_id() ; Sets/gets the public_id. element_decl $elt_decl = $doctype->element_decl( $name ) ;
Returns the XML::Doctype:Element object associated with $name. These can be defined by <!ELEMENT> tags or undefined, which can happen if they were just referred-to by <!ELEMENT> or <!ATTLIST> tags.
element_names Returns an unsorted list of element names. This list includes names that are declared and undeclared (but referred to in element declarations or attribute definitions). as_pm open( PM, "FooML/DTD/v1_001.pm" ) or die $! ; print PM $doctype->as_pm( FooML::DTD::v1_001 ) or die $! ; close PM or die $! ;
use FooML::DTD::v1_001 ; # Do *not* use () as a parameter list!
Returns string containing the DTD as an independant module, allowing the DTD to be parsed in the development environment and shipped as Perl code, so that the target environment need not have XML::Parser installed.
This is useful for XML creation-only tools and as an efficiency tuning measure if you will be rereading the same set of DTDs over and over again.
import use use XML::Doctype NAME => FooML, SYSTEM_ID => dtds/FooML.dtd ;
If XML::Doctype is subclassed, the subclasses constructor is called with all parameters.
Barrie Slaymaker <email@example.com>
This module is Copyright 2000, 2005 Barrie Slaymaker. All rights reserved.
This module is licensed under your choice of the Artistic, BSD or General Public License.
Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 83: =item outside of any =over Around line 466: You forgot a =back before =head1
|perl v5.20.3||XML::DOCTYPE (3)||2016-03-17|