1XPath::Literal(3) User Contributed Perl Documentation XPath::Literal(3)
2
3
4
6 XML::XPath::Literal - Simple string values.
7
9 In XPath terms a Literal is what we know as a string.
10
12 new($string)
13
14 Create a new Literal object with the value in $string. Note that "
15 and ' will be converted to " and ' respectively. That is not part
16 of the XPath specification, but I consider it useful. Note though that
17 you have to go to extraordinary lengths in an XML template file (be it
18 XSLT or whatever) to make use of this:
19
20 <xsl:value-of select=""I'm feeling &quot;sad&quot;""/>
21
22 Which produces a Literal of:
23
24 I'm feeling "sad"
25
26 value()
27
28 Also overloaded as stringification, simply returns the literal string
29 value.
30
31 cmp($literal)
32
33 Returns the equivalent of perl's cmp operator against the given $lit‐
34 eral.
35
36
37
38perl v5.8.8 2001-06-12 XPath::Literal(3)