XML::Li...Literal(3)
π XML::LibXML::Literal β the manual, but make it cute π
okay bestie, welcome to the XML::LibXML::Literal(3) page β yes it's a section 3 man page, yes it lives in User Contributed Perl Documentation, and yes it's about to be the most fun you've ever had reading about strings. β¨
πΈ NAME πΈ
XML::LibXML::Literal β literally just simple string values. that's it. that's the whole vibe. π
π¦ DESCRIPTION π¦
So when we're talking XPath terms, a Literal is what the rest of us call a string. no cap. same thing, fancier name, main character energy. π
β¨ API β¨
π new($string)
Makes you a brand new Literal object holding whatever's in $string. π«Ά
But here's the tea: " and ' get converted into " and ' respectively. Is that in the XPath spec? Nope. Not even a little. But the author thinks it's useful, and honestly? valid. π
β οΈ Heads up though β to actually use this inside an XML template file (XSLT, whatever else you're doing), you have to go to extraordinary lengths. Like, absurd amounts of effort. it's giving "why is it like this". π
Check it:
<xsl:value-of select=""I'm feeling &quot;sad&quot;""/>
And that whole chaotic situation produces a Literal of:
I'm feeling "sad"
See?? iconic, unhinged, and correct all at once. π
π value()
Also overloaded as stringification β so it just hands you back the literal string value. simple. clean. slay. β¨
π cmp($literal)
Returns the equivalent of perl's cmp operator, run against the $literal you passed in. comparison girlies, this one's for you. π
and that's the whole page, bestie!! π no more sections, no hidden lore, we ate and left no crumbs. π
little sign-off moment: this was perl v5.42.2, dated 2026-05-25, and yeah β the footer says XML::Li...Literal(3) because even man pages get their name truncated sometimes. ππ«Ά bye pookie!! π§π
π¦ where this page comes from
- fedora 43: perl-XML-LibXML 1:2.0213-1.fc43 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- fedora 44: perl-XML-LibXML 1:2.0213-1.fc44 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms