Web::DOM::XPathNSResolver
The DOM XPathNSResolver
object
DESCRIPTION
The Web::DOM::XPathNSResolver
class implements the DOM XPathNSResolver
interface.
In the DOM Perl Binding,
an XPathNSResolver
object can be represented as either a Perl subroutine (code) reference or an object returned by the create_ns_resolver
method of the Document
object.
The Web::DOM::XPathNSResolver class is used for the latter.
In other word,
the class is used to wrap an Web::DOM::Node object by the XPathNSResolver
interface.
If you'd like to define a custom namespace prefix resolver,
you should use a simple subroutine as an XPathNSResolver
.
The subroutine will be invoked by the XPath parser when a namespace resolution is performed,
with two arguments: $self (the code reference itself) and $prefix (the namespace prefix to resolve).
The subroutine is expected to return the corresponding namespace URL,
as a character string,
or undef
if the prefix is not has corresponding namespace URL.
METHOD
The following method is available:
$url = $resolver->lookup_namespace_uri ($prefix)
-
Return the namespace URL associated with the specified namespace prefix. [NSRESOLVER]
SPECIFICATIONS
- DOMXPATH
-
Document Object Model XPath
<http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver>
. - NSRESOLVER
-
Selectors API - The NSResolver Interface
<http://dev.w3.org/cvsweb/~checkout~/2006/webapi/selectors-api/Overview.html?rev=1.28&content-type=text/html;%20charset=utf-8#nsresolver-interface>
. - DOMPERL
-
manakai's DOM Perl Binding
<http://suika.suikawiki.org/~wakaba/wiki/sw/n/manakai%27s%20DOM%20Perl%20Binding>
.
SEE ALSO
AUTHOR
Wakaba <wakaba@suikawiki.org>.
LICENSE
Copyright 2012-2013 Wakaba <wakaba@suikawiki.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.