HTML::O...Function(3)
π NAME π
okay so this is the manual for HTML::Object::XPath::Function β the one your pager calls HTML::O...Function(3) in the User Contributed Perl Documentation β and it's all about HTML Object XPath Functions. slay. π
β¨ SYNOPSIS β¨
use HTML::Object::XPath::Function;
my $func = HTML::Object::XPath::Function->new ||
die( HTML::Object::XPath::Function->error, "\n" );
π VERSION π
v0.2.0 β that's the version, bestie. Vibe check: passed. β¨
π¦ DESCRIPTION π¦
This module implements various XPath functions, and they're all described below. It's giving utility module main character energy, and honestly? Obsessed. π
π οΈ CONSTRUCTOR π οΈ
Provided with an XPath object, a function "name", and function "parameters", this will instantiate a new HTML::Object::Function object and return it. Note the exact class there: HTML::Object::Function β not making this up. π«Ά
π§ METHODS π§
πΈ as_string πΈ
Returns a string representation of this function object. β¨
π« as_xml π«
Returns a xml representation of this function object. π¦
π₯ boolean π₯
Provided with a node object and a list of parameters, this returns the first parameter as a boolean object. It raises an exception if there's more than one argument provided. π
π ceiling π
Provided with a node object and an optional parameter, this returns the ceiling of the string value of the node, or the ceiling of the string value of the parameter provided, if any. It returns its value as a new number object. It raises an exception if more than one parameter was provided. π
π concat π
Provided with a node object and a list of 2 parameters or more, this returns a new literal object from the concatenation of each parameter's string value. β¨
π§ contains π§
Provided with a node object and a list of exactly 2 parameters, this returns true if the first parameter matches the second one as a regular expression, or false otherwise. π
π count π
Provided with a node object and a node set, this returns the size of the node set as a number. π―
π¦ evaluate π¦
Provided with a node object, this evaluates the node using each parameter set during object instantiation and adds the result for each into a new array.
It then returns the execution of the function name on the node, passing it the list of previously collected results. π
π false π
Returns false, and it raises an exception if any arguments were provided. π
π§ floor π§
Provided with a node object and an optional parameter, this returns the floor of the string value of the node, or the floor of the string value of the parameter provided, if any. It returns its value as a new number object. It raises an exception if more than one parameter was provided. β¨
π― id π―
Provided with a node object and 1 parameter, this returns a new node set of element objects that match the id found in the node provided. πͺͺ
π£οΈ lang π£οΈ
Provided with a node object and 1 parameter, this returns true if the node lang β if there is any at all β matches the one provided as a parameter; otherwise it returns false. π
π₯ last π₯
This takes no argument and returns the size, as a number, of the nodes in the context set in XPath. π
π§Έ local_name π§Έ
Provided with a node object and optionally some parameter, this returns the local name of the node, or that of the first parameter provided, if any, as a literal object. π·οΈ
π name π
Provided with a node object and optionally some parameter, this returns the name of the node, or that of the first parameter provided, if any, as a literal object. π
π« namespace_uri π«
This is an unsupported function, and it will raise an exception when called. No cap, that's the whole deal. π
π new_literal π
Returns a new literal object, passing it whatever arguments were provided. π
π§Ί new_nodeset π§Ί
Returns a new node set object, passing it whatever arguments were provided. π§Ί
π’ new_number π’
Returns a new number object, passing it whatever arguments were provided. π’
π§Ό normalize_space π§Ό
Provided with a node object and optionally some parameter, this takes the string value of the node β or that of the first parameter, if any at all β and removes any leading or trailing spaces, as well as replacing multiple spaces with just one space. It returns the new string as a literal object. β¨
π not π
Provided with a node object and one parameter, this returns true if the value of the first parameter is not true, or false otherwise. π
π’ number π’
Provided with a node object and optionally one parameter, this returns the node string value β or that of the parameter provided, if any β as a new number object. π―
π position π
Returns the context position as a number. It raises an exception if any parameter was provided. π§
π² round π²
No description provided in the source, bestie. That's literally just the method name sitting there. π«
πͺ starts_with πͺ
Provided with a node object and two parameters, this returns true if the string value of the second parameter is at the beginning of the first parameter, or false otherwise. π±
π§΅ string π§΅
Provided with a node object and one parameter, this returns the parameter string value as a new literal object.
It raises an exception if more than one parameter was provided. π
π string_length π
Provided with a node object and optionally one parameter, this returns the size, as a number, of the string value of the node, or that of the parameter if any was provided. π
βοΈ substring βοΈ
Provided with a node object and two or three parameters, this returns the substring of the first parameter as a value, at the offset specified by the second parameter, and optionally for a length defined by a third parameter, if any. If no third parameter is provided, then it goes until the end of the string.
It returns the substring as a new literal object. It raises an exception if less than 2 or more than 3 parameters were provided. π§΅
πͺ’ substring_after πͺ’
Provided with a node object and two parameters, this returns the string that follows the string value of the second parameter in the first one, up to its end.
It returns the substring as a new literal object. It raises an exception if less or more than 2 parameters were provided. π
πͺ‘ substring_before πͺ‘
Provided with a node object and two parameters, this returns the string that precedes the string value of the second parameter in the first one, up to its start.
It returns the substring as a new literal object. It raises an exception if less or more than 2 parameters were provided. π
β sum β
Provided with a node object and a parameter that must be a node set, this returns the cumulative string value of each node as a number.
It returns the resulting total as a new number object|HTML::Object::XPath::Number>. It raises an exception if the parameter provided is not a HTML::Object::XPath::NodeSet object. π°
π translate π
Provided with a node object and three parameters, this searches in the first parameter for any occurrence of characters found in the second parameter and replaces them with their alternative at the exact same position in the string in the third parameter.
It returns the substring as a new literal object. It raises an exception if less or more than 3 parameters were provided. π
β
true β
Returns true, and it raises an exception if any arguments were provided. π
ποΈ AUTHOR ποΈ
Author: Jacques Deguest <jack@deguest.jp> β yes, that's the email, bestie. π
π SEE ALSO π
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
iykyk β go read these next, bestie. π
βοΈ COPYRIGHT & LICENSE βοΈ
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.
periodt. π
okay bye bestie π
this page came from perl v5.42.2 and is dated 2026-02-15. Go forth and XPath responsibly. π¦
π¦ 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