Tree::...iteral(3pm)
β¨ Tree::XPathEngine::Literal β¨
okay bestie, welcome to the User Contributed Perl Documentation page for Tree::XPathEngine::Literal π (that's a 3pm manpage, for the record β perl module, third-party, iykyk).
πΈ NAME πΈ
Tree::XPathEngine::Literal β Simple string values. That's it. That's the whole vibe. π
π¦ DESCRIPTION π¦
So in XPath-speak, a Literal is literally just what the rest of us call a string. No cap. It's a wrapper around a string so the XPath engine can tell "this is a string" apart from numbers and booleans. β¨
π API π
π new($string)
Makes you a brand-new Literal object holding whatever you passed in as $string. Slay.
β οΈ Heads up though:"and'get converted to"and'respectively. That is not part of the XPath specification, but whoever wrote this considered it useful. π
But listen β because of that little quirk, you have to go to extraordinary lengths in an XML template file (XSLT or whatever, doesn't matter) to actually make use of it:
<xsl:value-of select=""I'm feeling &quot;sad&quot;""/>
Which produces a Literal of:
I'm feeling "sad"
Likeβ¦ the gymnastics. The hoops. The way that whole thing is doing the most just to get some quotation marks. π But it works. π«Ά
π value()
Also overloaded as stringification, and it simply returns the literal string value. No drama, no side quests. It just hands you the string back. π
π xpath_cmp($literal)
Returns the equivalent of perl's cmp operator, but against the given $literal. So you get that good good string-comparison energy, XPath style. β¨
π Other Methods π
These ones are needed so the objects can be properly processed in various contexts. They're the behind-the-scenes girlies holding it all together. π§
as_stringas_xmlvalueevaluatexpath_to_booleanxpath_to_literalxpath_to_numberxpath_string_value
and that's the whole page, bestie!! π this one's rocking perl v5.36.0, dated 2022-11-20, and it's filed under Tree::...iteral(3pm) because apparently we couldn't fit the whole name in the footer. iconic behaviour, honestly. take care of her, mwah ππβ
π¦ where this page comes from
- debian bookworm: libtree-xpathengine-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtree-xpathengine-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtree-xpathengine-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtree-xpathengine-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtree-xpathengine-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms