I'm very confused on XPathScript right now. In the AxKit documentation
(http://www.axkit.org/docs/xpathscript/guide.dkb?section=3) the following
example is displayed:
<%
for my $sect1 (findnodes("/article/sect1")) {
print $sect1->findvalue("title/text()"), "<br>\n";
for my $sect2 ($sect1->findnodes("sect2")) {
print " + ", $sect2->findvalue("title/text()"), "<br>\n";
for my $sect3 ($sect2->findnodes("sect3")) {
print " + + ",
$sect3->findvalue("title/text()"),
"<br>\n";
}
}
}
%>
This example makes perfect sense. But it doesn't seem to work that way. My
xps doc does this:
<%
my $cnode = findnodes ('//email/configuration');
my @rcpts;
for my $node ($cnode->findnodes('./recipients/recipient')) {
push @rcpts, $node->findvalue('text()');
}
%>
<html>
<head>
<title><%= findvalue('//data/title/text()') %></title>
</head>
<body>
Recipient list: <%= join(', ',@rcpts) %>
</body>
</html>
And the error I get is:
[AxKit] [Error] Can't locate object method "findnodes" via package
"XML::XPath::NodeSet" (perhaps you forgot to load "XML::XPath::NodeSet"?) at
/usr/local/odie_www/htdocs/stylesheets/emailprocess.xps line 10.
I understand that the return of findnodes() is XML::XPath::NodeSet. I've
read the man page on that, which refers me to the man page on
XML::XPath::XMLParser for how to get around in it, but it seems to be very
very difficult to pull out what I need. Am I missing something? Is there
someway to navigate the node list as in this example? Is there something
different or special about the source XML for the example?
Thanks!
Riley
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]