xpath - Extracting path from xml -


i trying extract particular xpath returned xml response on jmeter.

sample response xml:

<?xml version="1.0" encoding="utf-8"?> <responses> <rate href="http://test.com/psi?attribute1=x&attribute2=y"> <cost currency='usd'>10</cost> </rate> </responses> 

i using http://codebeautify.org/xpath-tester# obtain xpath. need cost "10". looking @ xpath - //responses/rate/cost/text() returns blank value. update xml (note: removed href part):

<?xml version="1.0" encoding="utf-8"?> <responses> <rate> <cost currency='usd'>10</cost> </rate> </responses> 

the same xpath //responses/rate/cost/text() returns "text = 10". idea problem href causing?

i tried xml , jmeter gives me:

assertion failure message: reference entity "attribute2" must end ';' delimiter. see log file further details.

and log contains:

2015/07/08 10:46:26 error - jmeter.util.xpathutil: type=val=false tol=false org.xml.sax.saxparseexception; linenumber: 1; columnnumber: 107; reference entity "attribute2" must end ';' delimiter.

2015/07/08 10:46:26 warn - jmeter.extractor.xpathextractor: saxexception while processing (//responses/rate/cost/) reference entity "attribute2" must end ';' delimiter.

so issue due wrong xml, should have:

 <?xml version="1.0" encoding="utf-8"?>  <responses>  <rate href="http://test.com/psi?attribute1=x&amp;attribute2=y">  <cost currency='usd'>10</cost>  </rate>  </responses> 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -