XML-Handler-YAWriter

 view release on metacpan or  search on metacpan

YAWriter.pm  view on Meta::CPAN

Add hidden tabulation for attributes

=item CatchEmptyElement boolean

Catch empty Elements, apply "/>" compression

=item CatchWhiteSpace boolean

Catch whitespace with comments

=item CompactAttrIndent

Places Attributes on the same line as the Element

=item IsSGML boolean

This option will cause start_document, processing_instruction and doctype_decl
to appear as SGML. The SGML is still well-formed of course, if your SAX events
are well-formed.

=item NoComments boolean

test.pl  view on Meta::CPAN


print "ok 5\n";

   $handler->{'AsFile'} = 'directory.tst';
   $handler->{'Pretty'} = {
        'NoWhiteSpace'       => 1,
        'PrettyWhiteNewLine' => 1,
        'PrettyWhiteIndent'  => 1,
        'CatchEmptyElement'  => 1,
        'AddHiddenAttrTab'   => 1,
        'CompactAttrIndent'  => 1
	};
   $parser->parse( 'Source' => { 'SystemId' => 'directory.xml' } );

print "ok 6\n";

   $handler->{'AsFile'} = 'cdataout.xml';
   $handler->{'Pretty'} = {
        'NoWhiteSpace' 	     => 1,
        'PrettyWhiteNewLine' => 1,
        'PrettyWhiteIndent'  => 1,
        'CatchEmptyElement'  => 1,
        'CompactAttrIndent'  => 1
	};
   $parser->parse( 'Source' => { 'SystemId' => 'cdatain.xml' } );

print "ok 7\n";

   $handler->{'AsFile'} = 'nullout.xml';
   $handler->{'Pretty'} = {
        CompactAttrIndent => 1,
        NoComments => 1,
        PrettyWhiteNewline => 1,
        PrettyWhiteIndent => 1,
        NoWhiteSpace => 1,
        CatchEmptyElement => 1
	};
   $parser->parse( 'Source' => { 'SystemId' => 'nullin.xml' } );

print "ok 8\n";



( run in 0.319 second using v1.01-cache-2.11-cpan-a5abf4f5562 )