XML::XP...:Literal(3)

🌸 NAME 🌸

Welcome to the XML::XP...:Literal(3) page, bestie β€” aka XML::XPathEngine::Literal. Simple string values. That's the whole assignment: a tiny Literal object whose main-character trait is holding a string. πŸ’…

πŸ’– DESCRIPTION πŸ’–

Okay so in XPath terms, a Literal is literally what we know as a string. That's the vibe. No extra lore. ✨

✨ API ✨

πŸŽ€ new($string) πŸŽ€

Creates a brand-new Literal object with the value in $string. 🫢

Important glow-up notice: " and ' get converted to " and ', respectively. That's not part of the XPath specification, but the author considers it useful. πŸ’–

That said, to actually make use of this in an XML template file (be it XSLT or whatever), you have to go to extraordinary lengths. Like, truly. 😭 Check it:

<xsl:value-of select="&quot;I'm feeling &amp;quot;sad&amp;quot;&quot;"/>

And boom, that gives you a Literal of:

I'm feeling "sad"

πŸ¦‹ value() πŸ¦‹

Also overloaded as stringification. It simply returns the literal string value. That's it. Iconic, low-effort, effective. πŸ‘‘

🌈 cmp($literal) 🌈

Returns the equivalent of perl's cmp operator against the given $literal. So you hand it a $literal, and it does the cmp thing. No cap. πŸ”₯


mwah πŸ’– this page is from perl v5.42.0, dated 2013-06-04, and it's the XML::XP...:Literal(3) manual from User Contributed Perl Documentation. Periodt. 🫢

πŸ“¦ where this page comes from