XML::ValidWriter 0.39 review
DownloadXML::ValidWriter is DOCTYPE driven valid XML output. SYNOPSIS ## As a normal perl object: $writer = XML::ValidWriter->ne
|
|
XML::ValidWriter is DOCTYPE driven valid XML output.
SYNOPSIS
## As a normal perl object:
$writer = XML::ValidWriter->new(
DOCTYPE => $xml_doc_type,
OUTPUT => *FH
) ;
$writer->startTag( 'b1' ) ;
$writer->startTag( 'c2' ) ;
$writer->end ;
## Writing to a scalar:
$writer = XML::ValidWriter->new(
DOCTYPE => $xml_doc_type,
OUTPUT => $buf
) ;
## Or, in scripting mode:
use XML::Doctype NAME => a, SYSTEM_ID => 'a.dtd' ;
use XML::ValidWriter qw( :all :dtd_tags ) ;
b1 ; # Emits < a >< b1 >
c2( attr=>"val" ) ; # Emits < /b1 >< b2 >< c2 attr="val" >
endAllTags ; # Emits < /c2 >< /b2 >< /a >
## If you've got an XML::Doctype object handy:
use XML::ValidWriter qw( :dtd_tags ), DOCTYPE => $doctype ;
## If you've saved a preparsed DTD as a perl module
use FooML::Doctype::v1_0001 ;
use XML::ValidWriter qw( :dtd_tags ) ;
#
# This all assumes that the DTD contains:
#
# < !ELEMENT a ( b1, b2?, b3* ) >
#
# < !ELEMENT b1 ( c1 ) >
# < !ELEMENT b2 ( c2 ) >
#
STATUS
Alpha. Use and patch, don't depend on things not changing drastically.
Many methods supplied by XML::Writer are not yet supplied here.
Requirements:
Perl
XML::ValidWriter 0.39 keywords