HTML::O...NodeSet(3)

๐Ÿ“ฆ version 0.6.0, in alpine 3.24

โœจ 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::XPath
  • HTML::Object::XPath::Boolean
  • HTML::Object::XPath::Expr
  • HTML::Object::XPath::Function
  • HTML::Object::XPath::Literal
  • HTML::Object::XPath::LocationPath
  • HTML::Object::XPath::NodeSet
  • HTML::Object::XPath::Number
  • HTML::Object::XPath::Root
  • HTML::Object::XPath::Step
  • HTML::Object::XPath::Variable
  • Copyright(c) 2021 DEGUEST Pte. Ltd.
  • All rights reserved
  • This 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