NAME

Data::DPath - Path based data manipulation

SYNOPSIS

use Data::DPath;

my $dp = Data::DPath -> new( apache => Apache::Request->new($r) );

my $dataset = $dp -> find('//*[@isa="Apache::Upload"]'); # find all uploads

foreach my $node ($dataset -> get_nodelist) {
    print "Found: ", $node -> data -> name,
             " as ", $node -> data -> filename, "\n";
}

API

The API of Data::DPath is very similar to that of XML::XPath.

new()

dataset = find($path, [$context])

dataset = findnodes($path, [$context])

findnodes_as_string($path, [$context])

Returns the data found reproduces as XML using Data::XMLDumper. The resulting XML may be used as the xml parameter to create a new Data::DPath object.

findvalue($path, [$context])

exists($path, [$context])

matches($node, $path, [$context])

getNodeText($path)

setNodeText($path, $value)

createNode($path)

Data Object Model

ACKNOWLEDGEMENTS

The Data::DPath package is based on XML::XPath. I took the XML::XPath tarball and changed it into Data::DPath, for the most part.

AUTHOR

James G. Smith, <jsmith@cpan.org>

COPYRIGHT

Copyright (C) 2003 Texas A&M University. All Rights Reserved

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.