XML::XPathExt

XML::XPathExt is a common XPath extension framework.
Download

XML::XPathExt Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Robin Berjon
  • Publisher web site:
  • http://search.cpan.org/~rberjon/XML-XPathExt-0.01_01/XPathExt.pm

XML::XPathExt Tags


XML::XPathExt Description

XML::XPathExt is a common XPath extension framework. XML::XPathExt is a common XPath extension framework.SYNOPSIS package XML::XPathExt::MyCoolExtension; use base 'XML::XPathExt'; my $ns = "http://perl-xml-rocks.org/java-xml-sucks/"; our @EXTENSIONS = ( , , ,); # your functions...This is a simple module, the goal of which is to help make XPath extensions consistent in such a way that they work with both XML::LibXSLT and XML::XPathContext.I would very much like to support other modules, but that will require more work (mostly around having factory methods that do the right thing to convert to the right objects, which is simple enough but long -- patches welcome).Your modules implementing XPath extensions should inherit from this class. It will do two things for them: if c< XML::LibXSLT > is present, when your class is loaded its extensions will be registered automatically; and you will inherit a registerOnContext method that when called with an XML::XPathContext context object will register all your extensions on it (it can't be done automatically as for XML::LibXSLT because and instance of the class is required).There's a special variable that should exist and be publically available in your package called @EXTENSIONS. It is an array containing arrayrefs. The synopsis should be pretty clear (hopefully) but in case it is not, each of those arrayrefs contains three items: the namespace URI, the name of the extension function, and a reference to its Perl implementation. Behaviour of extension functions with no defined namespace is not guaranteed and even if it works for you it may very well blow up in other cases. So it is quite a bad idea to not use a namespace. Requirements: · Perl


XML::XPathExt Related Software