Posted on 2007-04-18 13:49:06-07 by ehasas
Searching same Xpath with different values.
Hi, I am using ActivePerl v5.8.8. My aim is to search a XPath in a XML file and match the respective value present. I am using "xml_is" function of "Test::XML::Simple" package. It takes i) XML file, ii) XPath and iii) Value as input and returns status accordingly. Now the problem is if same XPaht is present for two times with different values, it returns value mismatch for both the Xpath. For example- XPath 1) /Library/Book/Perl/Name and value = "Perl In NutShell" Xpath 2) /Library/Book/Perl/Name and value = "ActivePerl Handbook" and XML file is like0- - - - Perl In NutShell Text Book - ActivePerl Handbook 150.00 Now in above XML file XPath "/Library/Book/Perl/Name" is present twice but with different values. Now if I call "xml_is" function passing this XPath and one of the value, it will return as value mismatch. Is there any way to distinguish between the two cases one of repetive XPath and second actual value mismatch for unique Xpath? Thanks in anticipation, -Ehasas
Direct Responses: 7199 | Write a response
Posted on 2008-02-25 22:40:27-08 by joemcmahon in response to 4924
Re: Searching same Xpath with different values.
Ehasas -

I will take a look at it and see if I can give you a fix. If you can post your test as you're running it (with some test data that shows the error), I'll be glad to include that as a new test for the module (and it will make it easier for me to deliver a fix that matches exactly your use case).

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.