Build Status Coverage Status

NAME

XML::LibXML::jQuery - Fast, jQuery-like DOM manipulation over XML::LibXML

SYNOPSIS

use XML::LibXML::jQuery;

my $div = j(<<HTML);
    <div>
        <h1>Hello World</h1>
        <p> ... </p>
        <p> ... </p>
    </div>
HTML

$div->find('h1')->text; # Hello World

$div->find('p')->size; # 2

DESCRIPTION

XML::LibXML::jQuery is a jQuery-like DOM manipulation module build on top of XML::LibXML for speed. The goal is to be as fast as possible, and as compatible as possible with the javascript version of jQuery. Unlike similar modules, web fetching functionality like -append($url)> was intentionally not implemented.

SIMILAR MODULES

Following is a list of similar CPAN modules.

CONSTRUCTOR

new

Parses a HTML source and returns a new XML::LibXML::jQuery instance.

EXPORTED FUNCTION

j

A shortcut to new.

METHODS

Unless otherwise noted, all methods behave exactly like the javascript version.

add

Implemented signatures:

Documentation and examples at http://api.jquery.com/add/.

add_class

Implemented signatures:

Documentation and examples at http://api.jquery.com/addClass/.

after

Implemented signatures:

Documentation and examples at http://api.jquery.com/after/.

append

append_to

as_html

attr

before

children

clone

contents

data

Implemented signatures:

Documentation and examples at http://api.jquery.com/data/.

detach

document

each

eq

end

find

get

html

insert_after

Implemented signatures:

Documentation and examples at http://api.jquery.com/insertAfter/.

insert_before

filter

first

last

parent

prepend

prepend_to

remove

remove_attr

remove_class

replace_with

serialize

size

tagname

text

xfind

Like "find", but uses a xpath expression instead of css selector.

xfilter

Like "filter", but uses a xpath expression instead of css selector.

LICENSE

Copyright (C) Carlos Fernando Avila Gratz.

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

AUTHOR

Carlos Fernando Avila Gratz <cafe@kreato.com.br>