Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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';


Comment on Re^3: XPath with node names and attributes...
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-08-31 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls