HTML::Object::XPath::Function - HTML Object XPath Functions
use HTML::Object::XPath::Function; my $func = HTML::Object::XPath::Function->new || die( HTML::Object::XPath::Function->error, "\n" );
v0.2.0
This module implements various XPath functions described below.
Provided with a XPath object, a function name and function parameters and this will instantiate a new HTML::Object::Function object and return it.
name
parameters
Returns a string representation of this function object.
Returns a xml representation of this function object.
Provided with a node object and a list of parameters and this will return the first parameter as a boolean object. It will raise an exception if there are more than one arguments provided.
Provided with a node object and an optional parameter, and this will return the ceiling of the string value of the node or that of the parameter provided, if any.
It returns its value as a new number object. It will raise an exception if more than one parameter was provided.
Provided with a node object and a list of 2 parameters or more and this will return a new literal object from the concatenation of each parameter string value.
Provided with a node object and a list of exactly 2 parameters and this will return true if the first parameter match the second one as a regular expression, or returns false otherwise.
Provided with a node object and a node set and this will return the size of the node set as a number
Provided with a node object and this will evaluate the node using each parameter set during object instantiation and add the result for each in a new array.
It will then return the execution of the function name on the node passing it the list of previously collected results.
Returns false and it will raise an exception if any arguments was provided.
Provided with a node object and an optional parameter, and this will return the floor of the string value of the node or that of the parameter provided, if any.
Provided with a node object and 1 parameter, and this will return a new node set of element object who match the id found in the node provided.
Provided with a node object and 1 parameter, and this will return true if the node lang, if any at all, match the one provide as a parameter, otherwise it returns false.
This takes no argument and returns the size, as a number of the nodes in the context set in XPath.
Provided with a node object and optionally some parameter and this will return the local name of the node, or that of the first parameter provided, if any, as a literal object
Provided with a node object and optionally some parameter and this will return the name of the node, or that of the first parameter provided, if any, as a literal object
This is an unsupported function and it will raise an exception when called.
Returns a new literal object passing it whatever arguments was provided.
Returns a new node set object passing it whatever arguments was provided.
Returns a new number object passing it whatever arguments was provided.
Provided with a node object and optionally some parameter and this will take the string value of the node, or that of the first parameter, if any at al, and remove any leading or trailing spaces as well as replacing multiple spaces by just one space, and return the new string as a literal object
Provided with a node object and one parameter and this will return true if the value of the first parameter is not true, or false otherwise.
Provided with a node object and optionally one parameter and this will return the node string value, or that of the parameter provided, if any, as a new number object
Returns th context position as a number. It will raise an exception if any parameter was provided.
Provided with a node object and two parameters and this will return true if the string value of the second parameter is at the beginning of the first parameter, or false otherwise.
Provided with a node object and one parameter and this returns the parameter string value as a new literal object
It will raise an exception if more than one parameter was provided.
Provided with a node object and optionally one parameter and this will return the size, as a number, of the string value of the node or that of the parameter if any was provided.
Provided with a node object and two or three parameters and this returns the substring of of the first parameter as a value, at 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 will be until the end of the string.
It returns the substring as a new literal object. It will raise an exception if less than 2 or more than 3 parameters were provided.
Provided with a node object and two parameters and this will return 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 will raise an exception if less or more than 2 parameters were provided.
Provided with a node object and two parameters and this will return the string that precede the string value of the second parameter in the first one up to its start.
Provided with a node object and a parameters that must be a node set and this will return 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 will raise an exception if the parameter provided is not a HTML::Object::XPath::NodeSet object.
Provided with a node object and three parameters, and this will search in the first parameter for any occurrence of characters found in the second parameter and replace them with their alternative at the exact same position in string in the third parameter.
It returns the substring as a new literal object. It will raise an exception if less or more than 3 parameters were provided.
Returns true and it will raise an exception if any arguments was provided.
Jacques Deguest <jack@deguest.jp>
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.
To install HTML::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Object
CPAN shell
perl -MCPAN -e shell install HTML::Object
For more information on module installation, please visit the detailed CPAN module installation guide.