![]() |
|
No such thing as a small change | |
PerlMonks |
Re^2: XPath with node names and attributes...by biswanath_c (Beadle) |
on Oct 16, 2009 at 17:33 UTC ( [id://801602]=note: print w/replies, xml ) | Need Help?? |
okay! here we go. I am just giving an example here that I tested and which demonstrates my problem: The XML:
The PERL script that tries to read the attribute:
If i search for XPath head/node1@attr1 , the code works fine and fetches the value of the node. If i use XPath XPath /head/node1@attr1 , the program gives the error : "/head/node1 not found!" If i use the Xpath, i get this error: Invalid expression If I use the XPath "/head/node1/@attr1", I get this error: Invalid expression
In Section
Seekers of Perl Wisdom
|
|