Re: Using XML::LibXML::SAX::Parser as replacement for XML::LibXML::SAX::Generator
Petr Pajas <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
2010/3/31 Kjetil Kjernsmo <[email protected]>: > Hi all, > > I'm writing a module that does some SAX filtering, and I start with a DOM > tree and end with a DOM tree. Thus, I would expect to use > XML::LibXML::SAX::Builder and XML::LibXML::SAX::Generator, but the latter > warns me that it is deprecated in favour of XML::LibXML::SAX::Parser (and > I'd like to follow that recommendation). > > However, the latter seems rather undocumented, but I had a look in the > code, and saw that it had a generate method, I tried to use it is a drop-in > replacement, but that didn't work. It doesn't seem to give me any events, > but I haven't looked very deeply into why it fails. How should the > X:L:SAX::Parser be used to replace X:L:SAX::Generator? True, the documentation for XML::LibXML::SAX::Parser is missing. However, have a look at the file t/14sax.t from the XML-LibXML distribution: http://cpansearch.perl.org/src/PAJAS/XML-LibXML-1.70/t/14sax.t There are some usage examples that might help, -- Petr > Please scroll to the rdfa_xhtml method near the end of > http://svn.kjernsmo.net/RDF-RDFa- > Template/trunk/lib/RDF/RDFa/Template/SimpleQuery.pm > to see the current code. > > Cheers, > > Kjetil > -- > Kjetil Kjernsmo > [email protected] > http://www.kjetil.kjernsmo.net/ > _______________________________________________ > Perl-XML mailing list > [email protected] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > _______________________________________________ Perl-XML mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs