Adding Double quotes inside Reg-EX xpath evaluation

ParasofttoudayaParasofttoudaya Posts: 212 ✭✭
edited September 2017 in SOAtest

Hi Team,

I am trying to concat a json string with my json databank result
It supossed to be result as {"hashvalue":"hascontentFromXPath"}.

As i am not able to pass "(double quote) inside the reg-ex, i just passed single quote get the below result.
concat("{'hashvalue':" ,"'","hascontentFromXPath","'","}") ===> {'hashvalue':'hascontentFromXPath'}

is there any way to insert double quotes in it. ??

Below thready says i have to use backslash before double quote, its not working parasoft.


  • benken_parasoftbenken_parasoft Posts: 618 ✭✭✭

    In XPath, use two double quotes to escape a single double quote:
    concat("{""hashvalue"":""", /some/xpath/text(), """}")

  • OmarROmarR Posts: 209 admin
    edited September 2017

    IT may be easier to wrap each section in a single quote, like so:

    concat ( ' {"hashvalue": ' , ' " ', /root/pennywise[1]/text() , ' " ', ' } ')

  • ParasofttoudayaParasofttoudaya Posts: 212 ✭✭

    Thanks OMAR, its working.

    I did tried ' " ', but inside two double quotes :(

Sign In or Register to comment.