HTML::O...:Literal(3)
๐ธ NAME ๐ธ โ HTML::O...:Literal(3) / HTML::Object::Literal
okay so bestie, this is the User Contributed Perl Documentation page for HTML::Object::Literal โ Simple string values. It's giving tiny string object with XPath energy, and we're gonna cover every single method. ๐
๐ SYNOPSIS ๐
use HTML::Object::Literal;
my $this = HTML::Object::Literal->new || die( HTML::Object::Literal->error, "\n" );
๐ท๏ธ VERSION ๐ท๏ธ
v0.2.0 โ periodt. โจ
๐ฆ DESCRIPTION ๐ฆ
In XPath terms a Literal is what we know as a string. No cap. ๐ช
This module inherits from Module::Generic::Scalar โ that's the family tree, bestie. ๐ณ
๐ METHODS ๐
๐ new
Provided with a "string" and this will create a new Literal object with the value in "string". Note that " and ' will be converted to " and ' respectively. That is not part of the XPath specification, but I consider 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 โ like, genuinely extraordinary lengths, bestie:
<xsl:value-of select=""I am feeling &quot;sad&quot;""/>
Which produces a Literal of:
I am feeling "sad"
๐ as_string
Returns a string representation of this literal. ๐งต
๐ as_xml
Returns a string representation as xml. โจ
๐ด evaluate
Does nothing. Returns the current object. It's literally the โno thoughts, head emptyโ method. ๐ซง
๐จ getAttributes
If called, this would return an error. ๐
๐จ getChildNodes
If called, this would return an error. ๐
๐จ getParentNode
If called, this would return an error. ๐
๐ฏ string_value
Returns the current value as-is. ๐ฏ
โ
to_boolean
Returns the current value as a boolean. ๐
๐ช to_literal
Returns the current object. ๐ฏ
๐ข to_number
Returns the current value as a number. ๐งฎ
๐งธ value
Also overloaded as stringification, simply returns the literal string value. ๐
๐ข value_as_number
Returns the current value as a number. ๐งฎ
๐ AUTHOR ๐
Jacques Deguest <jack@deguest.jp> โ iconic author behavior. ๐
๐ง SEE ALSO ๐ง
All the related modules, bestie:
HTML::ObjectHTML::Object::AttributeHTML::Object::BooleanHTML::Object::ClosingHTML::Object::CollectionHTML::Object::CommentHTML::Object::DeclarationHTML::Object::DocumentHTML::Object::ElementHTML::Object::ExceptionHTML::Object::LiteralHTML::Object::NumberHTML::Object::RootHTML::Object::SpaceHTML::Object::TextHTML::Object::XQuery
๐ 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.
bye bestie! ๐ซถ This page's source/version is perl v5.42.2, dated 2026-02-15, and the footer tag is HTML::O...:Literal(3). Stay slay and go wrap some strings. ๐
โจ
๐ฆ 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