Thread Stringification? (5 answers)
Opened by leo11 at 2010-03-22 23:11

leo11
 2010-03-22 23:11
#135166 #135166
User since
2008-08-14
250 Artikel
BenutzerIn
[default_avatar]
Hallo.

Code (perl): (dl )
1
2
3
4
$perl -w -MXML::XPath -MData::Dumper -e '$xp=XML::XPath->new(filename =>"$ARGV[0]"); $t=$xp->getNodeText(q(/a/b/c)); my %h; $h{"a"}=$t; print Dumper $t; print "\n>$t<\n"' a.xml
$VAR1 = bless( do{\(my $o = '1755269100')}, 'XML::XPath::Literal' );

>1755269100<


print Dumper $t gibt ein Objekt aus, während print $t einen String ausgibt. Warum? Wo kann ich das nachlesen?

In der Doku XML::XPath steht bei getNodeText:
Quote
Returns the text string for a particular XML node. Returns a string, or undef if the node doesn't exist.


Ist die Doku nun korrekt oder nicht?

VG
leo11

View full thread Stringification?