NAME

XML::TinyXML::Selector::XPath - XPath-compliant selector for XML::TinyXML

SYNOPSIS

    use XML::TinyXML;
    
    # first obtain an xml context:
    $xml = XML::TinyXML->new("rootnode", "somevalue", { attr1 => v1, attr2 => v2 });
    
    $selector = XML::TinyXML::Selector->new($xml, "XPath");
    
    #####
    Assuming the following xml data :
    <?xml version="1.0"?>
    <xml>
      <hello>world</hello>
      <foo>
        <![CDATA[ this should unescape <&; etc... :) ]]>
      </foo>
      <parent>
        <child1/>
        <child2/>
        <child3/>
      </parent>
      <parent>
        <blah>SECOND</blah>
      </parent>
    </xml>
    #####
    
    @res = $selector->select('/xml//parent');
    @res = $selector->select('//child*');
    @res = $selector->select('/xml/parent[2]/blah/..');
    @res = $selector->select('//blah/..');
    @res = $selector->select('//parent[1]/..');
    @res = $selector->select('//parent[1]/.');
    @res = $selector->select('//blah/.');

DESCRIPTION

XPath-compliant selector for XML::TinyXML

INSTANCE VARIABLES

METHODS

  • init ()

  • select ($expr, [ $cnode ])

SEE ALSO

    XML::TinyXML XML::TinyXML::Node XML::TinyXML::Selector

AUTHOR

xant, <xant@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2009 by xant

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.