Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: XPath with node names and attributes...

by thunders (Priest)
on Oct 20, 2009 at 17:04 UTC ( #802267=note: print w/replies, xml ) Need Help??

in reply to Re^2: XPath with node names and attributes...
in thread XPath with node names and attributes...

Didn't have a chance to test your example, but I think this is the problem:

$rule_source = "head/node1@attr1";

Perl thinks you want to insert the contents of an array called @attr1 into the string because you used double quotes. Since there is no such array your $rule_source ends up with just "head/node1". Either escape the '@' or use a single quoted string as in the examples below:

$rule_source = "head/node1\@attr1"; # or $rule_source = 'head/node1@attr1';

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://802267]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2016-10-26 05:24 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (335 votes). Check out past polls.