Forum Discussion

mkliba's avatar
mkliba
Occasional Contributor
15 years ago

Xquery in a groovy

Hi:

Is there any way to run an Xquery inside a groovy? Example, to export the result to a text file?


Thanks!

5 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Doesn't answer the question, but it might be easier to use a Property Transfer step to move your desired content to a Property step, then either use Groovy to write the value out to a file, or configure the Property step itself to write to a file.
  • mkliba's avatar
    mkliba
    Occasional Contributor
    Thanks anyway. But what I was looking for was to create an XML file using an XQuery to extract certain information of my original xml response.

    I found the way to do it using mxquery.jar. You may check http://www.mxquery.org.
    • peskums's avatar
      peskums
      New Contributor

      Hi,

      I am Exactly looing for the same thing, I have a response XML, against which i have to execute a XQuery, and get the result value. The Link provided by you (www.mzquery.org), seems to be updated, and am not able the get the solution. Can you please provide me the code inside groovy script which worked for you.

       

      Thanks,

      Kumarswamy

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    I guess I didn't understand your need. I'd be curious to know more details of what you were trying to do.
  • mkliba's avatar
    mkliba
    Occasional Contributor
    Well, I'm testing two versions of a WS. There are a lot of information in my responses and some of them change dinamically everytime, so I can not compare both responses as is. So, I running an Xquery on my responses to extract only the information I need and should be the same in both, save it to a file and then compare both files.