Changeset 1993

Show
Ignore:
Timestamp:
10/03/06 01:33:02
Author:
miyagawa
Message:

fixed SYNOPSIS. Added functional interface. Added test using H::TB::XPath

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • HTML-Selector-XPath/trunk/MANIFEST

    r1991 r1993  
    2323t/00_compile.t 
    2424t/01_xpath.t 
     25t/02_html.t 
    2526t/99_pod.t 
  • HTML-Selector-XPath/trunk/lib/HTML/Selector/XPath.pm

    r1992 r1993  
    33use strict; 
    44our $VERSION = '0.01'; 
     5 
     6require Exporter; 
     7our @EXPORT_OK = qw(selector_to_xpath); 
     8*import = \&Exporter::import; 
     9 
     10sub selector_to_xpath { 
     11    __PACKAGE__->new(shift)->to_xpath; 
     12} 
    513 
    614my $reg = { 
     
    147155  use HTML::Selector::XPath; 
    148156 
    149   my $selector = HTML::Selector::XPath->new("li.main"); 
     157  my $selector = HTML::Selector::XPath->new("li#main"); 
    150158  $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'); 
    151163 
    152164=head1 DESCRIPTION 
     
    182194=head1 SEE ALSO 
    183195 
     196L<http://www.w3.org/TR/REC-CSS2/selector.html> 
    184197L<http://use.perl.org/~miyagawa/journal/31090> 
    185198