30 Mar 2018 01:17:27 UTC
- Distribution: XML-Writer-Lazy
- Module version: 0.05
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (204 / 44 / 0)
- KwaliteeBus factor: 1
- % Coverage
- License: mit
- Perl: v5.8.0
- Activity24 month
- Download (8.29KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionSARGIE Peter Sergeantand 1 contributors
- ['Peter Sergeant']
XML::Writer::Lazy - Pass stringified XML to XML::Writer
Pass stringified XML to XML::Writer
my $writer = XML::Writer::Lazy->new( OUTPUT => 'self'); my $title = "My Title!"; $writer->lazily(<<"XML"); <html> <head> <title>$title</title> </head> <body> <p>Pipe in literal XML</p> XML $writer->startTag( "p", "class" => "simple" ); $writer->characters("Alongside the usual interface"); $writer->characters("123456789"); $writer->lazily("</p></body></html>");
This is 2016. The computer should do the hard work. Life's too short to write a bunch of
endTagwhen my computer's perfectly capable of figuring out the right thing to do if I give it a chunk of XML.
Using a SAX parser whose events are then passed back to XML::Writer.
This is a subclass of XML::Writer.
new()and then instantiates the lazy parser pieces. Accepts all the same arguments as the parent method.
Take a string of XML. It should be parseable, although doesn't need to be balanced.
<foo><bar>asdfis fine, where
<foois not. Exercises the XML::Writer methods appropriately to re-create whatever you'd passed in.
Only important if you're doing strange things with the
OUTPUTafter instantiation. In order to keep track of what's been written already, this class wraps the
OUTPUTobject inside a delegate that intercepts and stores the contents of
Peter Sergeant -
MIT - see the
LICENSEfile included in the tar.gz of this distribution.
Module Install Instructions
To install XML::Writer::Lazy, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install XML::Writer::Lazy
For more information on module installation, please visit the detailed CPAN module installation guide.