HTML::O...NodeSet(3)
โจ NAME โจ
okay bestie, welcome to the HTML::O...NodeSet(3) page โ yes, the User Contributed Perl Documentation one โ and it's the manual for HTML::Object::XPath::NodeSet, aka HTML Object XPath Node Set. that's literally the whole NAME vibe, and it ate. ๐
๐ SYNOPSIS ๐
okay so here's the exact synopsis, no cap โ copy it, run it, live your truth:
use HTML::Object::XPath::NodeSet;
my $set = HTML::Object::XPath::NodeSet->new ||
die( HTML::Object::XPath::NodeSet->error, "\n" );
my $results = $xp->find( '//someelement' );
if( !$results->isa( 'HTML::Object::XPath::NodeSet' ) )
{
print( "Found $results\n" );
exit;
}
foreach my $context ( $results->get_nodelist )
{
my $newresults = $xp->find( './other/element', $context );
# ...
}
โญ VERSION โญ
v0.2.0 โ ngl, periodt. ๐
๐ฆ DESCRIPTION ๐ฆ
vibe check: this module contains an ordered list of nodes. each node takes the same format as described in HTML::Object::XPath. that's the tea, and honestly it's giving organized main character energy โ slay. ๐
๐ METHODS ๐
โจ new
bestie, you should never have to create a new NodeSet object โ it is all done for you by HTML::Object::XPath. iconic. โจ
๐ซถ append
given a nodeset, this appends the list of nodes in that nodeset to the end of the current list. highkey handy. ๐ซถ
๐ฏ get_node
hand it an integer position, and it returns the node at that position. ๐ฏ
not me reminding you again: the node position in XPath is based at 1, not 0. fr fr. ๐
๐ get_nodelist
returns a list of nodes. see HTML::Object::XPath for the format of the nodes. ๐
๐ฑ getChildNodes
the way that it returns a list of all elements' own child nodes by calling getChildNodes on each one of them is so clean. ๐ฑ
๐ getElementById
returns a list of all elements' own id by calling getElementById on each one of them. ๐
๐ณ getRootNode
returns the first element's value of getRootNode. ๐ณ
๐ new_literal
returns a new HTML::Object::XPath::Literal object, passing it whatever arguments was provided. ๐
๐ข new_number
returns a new HTML::Object::XPath::Number object, passing it whatever arguments was provided. ๐ข
๐ซง pop
equivalent to perl's pop in perlfunc function. this removes the last element from our stack and returns it. ๐ซง
๐ฅ prepend
given a nodeset, prepends the list of nodes in that nodeset to the front of the current list. ๐ฅ
๐ push
provided with a list of nodes, this will add them to the stack in this object. equivalent to perl's push in perlfunc function. ๐
๐งน remove_duplicates
this removes any duplicates there might be in our internal list of elements. spring cleaning, but make it nodes. ๐งน
๐ reverse
this method reverses the order of the elements in our internal list of elements. ๐
โ๏ธ shift
equivalent to perl's shift in perlfunc function. that's it, that's the tweet. โ๏ธ
๐ข size
returns the number of nodes in the HTML::Object::XPath::NodeSet. ๐ข
๐งฎ sort
this method sorts all the elements by comparing them to one another using cmp. obsessed with a tidy sort. ๐งฎ
๐ string_value
returns the string-value of the first node in the list. see the HTML::Object::XPath specification for what "string-value" means. ๐
๐ string_values
returns a list of the string-values of all the nodes in the list. ๐
โ to_boolean
returns true if there are elements in our internal array of elements, or false otherwise. โ
๐งต to_final_value
returns a string resulting from the concatenation of each elements' string value. ๐งต
๐ to_literal
returns the concatenation of all the string-values of all the nodes in the list. ๐
๐ข to_number
returns a new number object from the value returned from to_literal. ๐ข
โฌ๏ธ unshift
provided with a list of nodes, this will add them at the top of the stack in this object. equivalent to perl's unshift in perlfunc function. โฌ๏ธ
๐ AUTHOR ๐
author: Jacques Deguest <jack@deguest.jp> ๐ โ absolute icon behavior, slay. ๐ซถ
๐ SEE ALSO ๐
like, go read these too, iykyk โ obsessed:
HTML::Object::XPathHTML::Object::XPath::BooleanHTML::Object::XPath::ExprHTML::Object::XPath::FunctionHTML::Object::XPath::LiteralHTML::Object::XPath::LocationPathHTML::Object::XPath::NodeSetHTML::Object::XPath::NumberHTML::Object::XPath::RootHTML::Object::XPath::StepHTML::Object::XPath::Variable
๐ COPYRIGHT & LICENSE ๐
Copyright(c) 2021 DEGUEST Pte. Ltd.All rights reservedThis program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole manual, bestie โ you ate that! ๐
โจ this page was sourced from perl v5.42.2, dated 2026-02-15, and it's the HTML::O...NodeSet(3) page. now go forth and XPath, fr fr. ๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 ยท GPL-1.0-or-later OR Artistic-1.0-Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms