The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XML::DTD::Element - Perl module representing an element declaration in a DTD

SYNOPSIS

  use XML::DTD::Element;

  my $entman = XML::DTD::EntityManager->new;
  my $elt = XML::DTD::Element->new($entman, '<!ELEMENT a (#PCDATA)>');

DESCRIPTION

XML::DTD::Element is a Perl module representing an element declaration in a DTD.

new
  $entman = XML::DTD::EntityManager->new;
  $elt = new XML::DTD::Element($entman, '<!ELEMENT a (b?,c)>');

Constructs a new XML::DTD::Element object.

writexml
  $xo = new XML::Output({'fh' => *STDOUT});
  $elt->writexml($xo);

Write an XML representation of the element.

name
  $eltname = $elt->name;

Return the name of the element.

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

contentmodel
  $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;

SEE ALSO

XML::DTD, XML::DTD::Component, XML::DTD::ContentModel

AUTHOR

Brendt Wohlberg <wohl@cpan.org>

COPYRIGHT AND LICENSE

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.

ACKNOWLEDGMENTS

Peter Lamb <Peter.Lamb@csiro.au> improved entity substitution.