Changeset 1139
- Timestamp:
- 11/05/07 15:25:43 (6 years ago)
- Location:
- lang/perl/HTML-Selector-XPath/trunk
- Files:
-
- 1 added
- 2 modified
-
MANIFEST (modified) (1 diff)
-
lib/HTML/Selector/XPath.pm (modified) (3 diffs)
-
t/02_html.t (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTML-Selector-XPath/trunk/MANIFEST
r1137 r1139 23 23 t/00_compile.t 24 24 t/01_xpath.t 25 t/02_html.t 25 26 t/99_pod.t -
lang/perl/HTML-Selector-XPath/trunk/lib/HTML/Selector/XPath.pm
r1138 r1139 3 3 use strict; 4 4 our $VERSION = '0.01'; 5 6 require Exporter; 7 our @EXPORT_OK = qw(selector_to_xpath); 8 *import = \&Exporter::import; 9 10 sub selector_to_xpath { 11 __PACKAGE__->new(shift)->to_xpath; 12 } 5 13 6 14 my $reg = { … … 147 155 use HTML::Selector::XPath; 148 156 149 my $selector = HTML::Selector::XPath->new("li .main");157 my $selector = HTML::Selector::XPath->new("li#main"); 150 158 $selector->to_xpath; # //li[@id='main'] 159 160 # functional interface 161 use HTML::Selector::Xpath 'selector_to_xpath'; 162 my $xpath = selector_to_xpath('div.foo'); 151 163 152 164 =head1 DESCRIPTION … … 182 194 =head1 SEE ALSO 183 195 196 L<http://www.w3.org/TR/REC-CSS2/selector.html> 184 197 L<http://use.perl.org/~miyagawa/journal/31090> 185 198
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)