XPATH - How to get rid of warnings or whats wrong!

P

pod69

Hello,
I have an Xpath expression:

//foo[translate(text(),"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")="'bla'"]

Here i check if i can find bla in a foo tag - and its case
insensitive. If i use this expression I get warnings (failures?):

Unrecognized escape \Q passed through at (eval 4) line 1.
Unrecognized escape \E passed through at (eval 4) line 1.
Unrecognized escape \Q passed through at (eval 4) line 1.
Unrecognized escape \E passed through at (eval 4) line 1.

and I dont know what they mean?

if i check without the case sensitive test it works fine?

Does anyone know how to get rid of that warnings?

thx pod69
 
P

pod69

Hello!

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl

use XML::XPath;
use XML::XPath::XMLParser;

my $xml = do{ local $/; <DATA> };

my $xpath =
XML::XPath->new(
$xml
);
my $command =
'//foo[translate(text(),"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")="java"]';

my $nodeset = $xpath->find($command);
foreach my $node ( $nodeset->get_nodelist ) {
my $t = XML::XPath::XMLParser::as_string($node)."\n";
print $t;
}

__DATA__
<foo>Java</foo>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
The output of this program is:

Unrecognized escape \Q passed through at (eval 4) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 4) line 1, <DATA> line
1.
Unrecognized escape \Q passed through at (eval 4) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 4) line 1, <DATA> line
1.
<foo>Java</foo>


thank you for your help!
 
P

pod69

Hello,

Thank you very much for your help. The program works fine but still the
output is:

Unrecognized escape \Q passed through at (eval 4) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 4) line 1, <DATA> line
1.
Unrecognized escape \Q passed through at (eval 4) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 4) line 1, <DATA> line
1.
Unrecognized escape \Q passed through at (eval 5) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 5) line 1, <DATA> line
1.
Unrecognized escape \Q passed through at (eval 5) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 5) line 1, <DATA> line
1.
Unrecognized escape \Q passed through at (eval 6) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 6) line 1, <DATA> line
1.
Unrecognized escape \Q passed through at (eval 6) line 1, <DATA> line
1.
Unrecognized escape \E passed through at (eval 6) line 1, <DATA> line
1.
<foo>Java</foo>

Use #!/usr/bin/perl -w and you see all the warnings!

thx
 
P

pod69

hello

thank you for your reply - i use eclipse as my IDE and maybe because of
that the behaviour is strange but i still get the warnings only if i
use the console i dont get them!

thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,844
Latest member
JudyGvh32

Latest Threads

Top