| XML-DTD documentation | view source | Contained in the XML-DTD distribution. |
XML::DTD::Element - Perl module representing an element declaration in a DTD
use XML::DTD::Element; my $entman = XML::DTD::EntityManager->new; my $elt = XML::DTD::Element->new($entman, '<!ELEMENT a (#PCDATA)>');
XML::DTD::Element is a Perl module representing an element declaration in a DTD.
$entman = XML::DTD::EntityManager->new; $elt = new XML::DTD::Element($entman, '<!ELEMENT a (b?,c)>');
Constructs a new XML::DTD::Element object.
$xo = new XML::Output({'fh' => *STDOUT});
$elt->writexml($xo);
Write an XML representation of the element.
$eltname = $elt->name;
Return the name of the element.
print $elt->contentspec;
Return the content specification text. Note that this is the literal text of the specification in the DTD, without any entity expansion.
$cm = $elt->contentmodel;
Return the parsed content specification as a content model object reference. If a string representation of the parsed content model with entities expanded is desired, use
$cs = $elt->contentmodel->string;
Brendt Wohlberg <wohl@cpan.org>
Copyright (C) 2004-2010 by Brendt Wohlberg
This library is available under the terms of the GNU General Public License (GPL), described in the GPL file included in this distribution.
Peter Lamb <Peter.Lamb@csiro.au> improved entity substitution.
| XML-DTD documentation | view source | Contained in the XML-DTD distribution. |