HTML::O...Literal(3)
π HTML::Object::XPath::Literal(3) β HTML Object XPath Literal π
okay bestie, welcome to the manual page for HTML::O...Literal(3) from the User Contributed Perl Documentation crew. This is the XPath literal module, and it is lowkey serving βstring but make it object.β πβ¨
πΈ NAME πΈ
HTML::Object::XPath::Literal β HTML Object XPath Literal
π¦ SYNOPSIS π¦
use HTML::Object::XPath::Literal;
my $this = HTML::Object::XPath::Literal->new ||
die( HTML::Object::XPath::Literal->error, "\n" );
π VERSION π
This one is v0.2.1, no cap.
π§ DESCRIPTION π§
This module implements the equivalent of a string in XPath parlance. Thatβs the whole vibe: literal string, XPath edition. slay. π
β¨ METHODS β¨
π new β new literal, who dis?
Provided with a "string", this creates a new HTML::Object::XPath::Literal object with the value you hand it (the source says providedd, and we respect the typo). Note that " and ' will be converted to " and ' respectively. That is not part of the XPath specification, but the author considers it useful. π
Note though that you have to go to extraordinary lengths in an XML template file (be it XSLT or whatever) to make use of this:
<input type="text" value=""I am feeling &quot;perplex&quot;"" />
Which produces a Literal of:
I am feeling "perplex"
πΈ as_string
Returns a string representation of the literal. Cute, simple, stringified. This method ate. β¨
π¦ as_xml
Returns a string representation of the literal as xml. XML girlies rise. π
π cmp
This is a method used for overload. Provided with another object or string, this will return the same value as cmp in perlop, that is it βreturns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right argument.β Periodt. π
β evaluate
It returns the current object. Main character energy: it simply returns itself. π
π getChildNodes
This raises an exception, as it cannot be used. Hard no, bestie. π«
π getAttributes
This raises an exception, as it cannot be used. Same hard no. π«
π getParentNode
This raises an exception, as it cannot be used. The no continues. π«
π₯ new_number
Returns a new number object based on the value provided. Number object activated. π’
π string_value
Returns the value of the literal as returned by value. Itβs giving βsame value, different door.β πͺ
π to_boolean
Returns true if the literal value is true, or false otherwise. Boolean vibe check. β β
π to_literal
Returns the current object. Again, main character energy. π
π to_number
Returns a new number object from the value of the literal. Number object, but sourced from the literal. π’
π§ value
This returns the literal string value. It is also called upon stringification. So when the object gets stringified, this is the method on duty. π
π value_as_number
Returns the literal value as a number (not a number object), but forcing perl to treat it as a number, i.e. prepending it with a plus sign. Raw number, no object wrapper. β¨
π AUTHOR π
Jacques Deguest <jack@deguest.jp>. iykyk.
π«Ά SEE ALSO π«Ά
Go check these out, fr fr:
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 π
The formal tea, periodt:
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! Footer tea: this page is from perl v5.42.2, dated 2026-02-15, and the manual tag is HTML::O...Literal(3). go off and literal-ify something cute π
π«Ά
π¦ 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