Brendt Wohlberg > XML-DTD > XML::DTD

Download:
XML-DTD-0.08.tar.gz

Dependencies

Annotate this POD (1)

CPAN RT

Open  0
Report a bug
Module Version: 0.08   Source  

NAME ^

XML::DTD - Perl module for parsing XML DTDs

SYNOPSIS ^

  use XML::DTD;

  my $dtd = new XML::DTD;
  open(FH,'<file.dtd');
  $dtd->fread(*FH);
  close(FH);
  $dtd->fwrite(*STDOUT);

ABSTRACT ^

  XML::DTD is a Perl module for parsing XML DTD files.

DESCRIPTION ^

  XML::DTD is a Perl module for parsing XML DTDs. The following
  methods are provided.
new
  $dtd = new XML::DTD [ ($val) ];

Constructs a new XML::DTD object.

Its parser will be validating, and hence will make parameter entity substitutions, if the argument $val is present and non-zero.

fread
  $dtd->fread(*FILEHANDLE [, $uri]);

Parse a DTD file. If the URI is passed, it is used as the URI for the document entity.

sread
  $dtd->sread($string [, $uri]);

Parse DTD text in a string. If the URI is passed, it is used as the URI for the document entity.

fwrite
  $dtd->fwrite(*FILEHANDLE);

Write the DTD to a file.

swrite
  $string = $dtd->swrite();

Return the DTD text as a string.

fwritexml
  $dtd->fwritexml(*FILEHANDLE);

Write an XML representation of the DTD to a file.

swritexml
  $string = $dtd->swritexml();

Return an XML representation of the DTD text as a string.

elementlist
  $elts = $dtd->elementlist;

Return a list of element names.

element
  $eltobj = $dtd->element('elementname');

Return element object associated with the specified name.

attlist
  $attlistobj = $dtd->attlist('elementname');

Return atribute list object associated with the specified name.

SEE ALSO ^

XML::DTD::Parser, The XML 1.0 W3C Recommendation at http://www.w3.org/TR/REC-xml/

AUTHOR ^

Brendt Wohlberg <wohl@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2004-2006 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> added fetching of external entities and improved entity substitution.