Posted on 2005-12-01 05:27:22-08 by drf5n
Is there a way to do doctype( Inline )
Is there a way to post an inline DTD ( http://www.w3schools.com/dtd/dtd_intro.asp ) and validate against it with XML::Writer? Essentially, I'm looking for the example in http://search.cpan.org/dist/XML-Writer/Writer.pm modified to something more valid like:
use XML::Writer; use IO::File; my $output = new IO::File(">output.xml"); my $writer = new XML::Writer(OUTPUT => $output); $writer->xmlDecl('UTF-8'); $writer->>doctype(<<'EODTD'); greeting [ <!ELEMENT greeting (#PCDATA)> ] EODTD $writer->startTag("greeting", "class" => "simple"); $writer->characters("Hello, world!"); $writer->endTag("greeting"); $writer->end(); $output->close();
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.