Skip Menu |
 

This queue is for tickets about the HTML-Selector-XPath CPAN distribution.

Report information
The Basics
Id: 73719
Status: resolved
Priority: 0/
Queue: HTML-Selector-XPath

People
Owner: Nobody in particular
Requestors: mail [...] tobyinkster.co.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Add a prefix option to the to_xpath method.
Download (untitled) / with headers
text/plain 302b
Given a selector like this: div p It generates an XPath like this: //div//p The attached patch allows you to pass an optional prefix for elements to the output: //xhtml:div//xhtml:p This is useful given: http://search.cpan.org/~shlomif/XML-LibXML-1.89/lib/XML/LibXML/ Node.pod#findnodes
Subject: hsxp-prefix.diff
Download hsxp-prefix.diff
text/x-diff 514b
--- /usr/lib/perl5/site_perl/5.10.1/HTML/Selector/XPath.pm 2011-11-24 22:14:11.000000000 +0000 +++ lib/XML/LibXML/QuerySelector/ToXPath.pm 2012-01-03 22:39:44.410280697 +0000 @@ -139,6 +139,11 @@ } else { $tag = '*'; } + + if (defined $parms{prefix} and not $tag =~ /[*:|]/) { + $tag = join ':', $parms{prefix}, $tag; + } + if (! $wrote_tag++) { push @parts, $tag; $tag_index = $#parts;
Resolved in 0.13


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.