|
NAMEXML::AutoWriter - DOCTYPE based XML outputSYNOPSISuse XML::Doctype NAME => a, SYSTEM_ID => 'a.dtd' ; use XML::AutoWriter qw( :all :dtd_tags ) ; # # a.dtd contains: # # <!ELEMENT a ( b1, b2?, b3* ) > # <!ATTLIST a aa1 CDATA #REQUIRED > # <!ELEMENT b1 ( c1 ) > # <!ELEMENT b2 ( c2 ) > # 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::AutoWriter qw( :dtd_tags ), DOCTYPE => $doctype ; ## If you've saved a preparsed DTD as a perl module use FooML::Doctype::v1_0001 ; use XML::AutoWriter qw( :dtd_tags ) ; ## Or as a normal perl object: $writer = XML::AutoWriter->new( ... ) ; $writer->startTag( 'b1' ) ; $writer->startTag( 'c2' ) ; $writer->end ; STATUSAlpha. Use and patch, don't depend on things not changing drastically.Many methods supplied by XML::Writer are not yet supplied here. DESCRIPTIONThis module subclasses XML::ValidWriter and provides automatic start and end tag generation, allowing you to emit only the 'important' tags.See XML::ValidWriter for the details on all functions not documented here. XML::Writer API compatibilityMuch of the interface is patterned after XML::Writer so that it can possibly be used as a drop-in replacement. It will take awhile before this module emulates enough of XML::Writer to be a drop-in replacement in situations where the more advanced XML::Writer methods are used.Automatic start tagsAutomatic start tag creation is done when emitting a start tag that is not allowed to be a child of the currently open tag but is allowed to be contained in the currently open tag's subset. In this case, the minimal number of start tags necessary to allow All start tags between the current tag and the desired tag are automatically emitted with no attributes.Automatic end tagsIf start tag autogeneration fails, then end tag autogeneration is attempted. startTag() scans the stack of currently open tags trying to close as few as possible before start tag autogeneration suceeds.Explicit end tags may be emitted to prevent unwanted automatic start tags, and, in the future, warnings or errors will be available in place of automatic start and end tag creation. METHODS AND FUNCTIONSAll of the routines in this module can be called as either functions or methods unless otherwise noted.To call these routines as functions use either the DOCTYPE or :dtd_tags options in the parameters to the use statement: use XML::AutoWriter DOCTYPE => XML::Doctype->new( ... ) ; use XML::AutoWriter qw( :dtd_tags ) ; This associates an XML::AutoWriter and an XML::Doctype with the package. These are used by the routines when called as functions.
AUTHORBarrie Slaymaker <barries@slaysys.com>COPYRIGHTThis module is Copyright 2000, 2005, 2009 Barrie Slaymaker. Some rights reserved.This module is licensed under your choice of the Artistic, BSD or General Public License. POD ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |