Should I subclass XML::Parser?
No, that kind of approach is deprecated these days.
If you want access to the XML contents as an event stream (like XML::Parser's Handler interface) then the best option would be to use SAX. Your code would use XML::SAX::ParserFactory to get an object capable of parsing XML. This object might use XML::SAX::PurePerl, XML::LibXML::SAX, XML::SAX::Expat or something else depending on what was installed on the target machine. These parser modules are all written to the SAX API so you don't need to worry about which one you get.
On the other hand, if you'd prefer to access the XML contents as a DOM tree then once again XML::Parser would not be the best answer. XML::Parser's Tree interface is not really an object model and certainly not DOM compliant. XML::DOM uses XML::Parser to provide a DOM level 1 API but a better bet would be either XML::LibXML or XML::GDOME which provide DOM level 2 APIs (XPath and namespace support being the key bits you want). Whether you'd subclass these modules or simply use them is up to you.
You may find the Perl XML FAQ useful.
In reply to Re: How to implement XML languages
by grantm
in thread How to implement XML languages
by gildir
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |