Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8256373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:50:45+00:00 2026-06-08T01:50:45+00:00

response xml text is : <?xml version=1.0 encoding=UTF-8?><MMP><MERCHANT><RESPONSE><url>http://XXXXXXx/asdasd/asdsd/as</url><param name=ttype>QEQW</param><param name=tempTxnId>155411</param><param name=token>v22mM1NmwpHCKLp%2FZJC%2B7PUKASXr2aS01JPi2ZXDqT0%3D</param><param name=txnStage>1</param></RESPONSE></MERCHANT></MMP> I want

  • 0

response xml text is :

"<?xml version="1.0" encoding="UTF-8"?><MMP><MERCHANT><RESPONSE><url>http://XXXXXXx/asdasd/asdsd/as</url><param name="ttype">QEQW</param><param name="tempTxnId">155411</param><param name="token">v22mM1NmwpHCKLp%2FZJC%2B7PUKASXr2aS01JPi2ZXDqT0%3D</param><param name="txnStage">1</param></RESPONSE></MERCHANT></MMP>"

I want to parse this xml text in grails/groovy. How do I iterate through all the elements to fetch the data of a particular element?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:50:46+00:00Added an answer on June 8, 2026 at 1:50 am

    You can use the XMLSlurper to read the xml.

    Here is some example code for your posted xml:

    def response = new XmlSlurper().parseText(xml)
    
    // accessing a specific element
    println response.MERCHANT.RESPONSE.url
    // iterating through a collection
    response.MERCHANT.RESPONSE.param.each{println it}
    // searching for specific elements
    println response.MERCHANT.RESPONSE.param.find{it.@name == 'ttype'}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

XML response <?xml version=1.0 encoding=UTF-8 standalone=yes ?> - <Film> <film_id>1</film_id> <title>ACADEMY DINOSAUR</title> <description>xxx</description> <length>86</length>
I have an getting an xml response on this format <?xml version=\1.0\ encoding=\utf-8\?>\r\n <PlatformResponse
I have a XML Like this: <?xml version=1.0 encoding=utf-8?> <soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema> <soap:Body>
HttpContext.Current.Response.ContentType = text/xml; HttpContext.Current.Response.ContentEncoding = Encoding.UTF8; HttpPostedFile file = HttpContext.Current.Request.Files[0]; XDocument doc = XDocument.Load(XmlReader.Create(file.InputStream));
I have this xml result from calling the page getRout.php <?xml version=1.0 encoding=UTF-8?> <kml
xml.append(<alertDesc>); xml.append(desc); xml.append(</alertDesc>); response.getWriter().write(xml.toString()); response.setContentType(text/xml); response.setHeader(Cache-Control, no-cache); xml is a StringBuffer object. I have
I've used xml type by writing (asp coding) Response.ContentType = text/xml Now xml contents
My HttpHandler looks like: public void ProcessRequest(HttpContext context) { context.Response.ContentType = text/xml; XmlWriter writer
Here is my XML Response: <DIDL-Lite xmlns=urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/ xmlns:dc=http://purl.org/dc/elements/1.1/ xmlns:upnp=urn:schemas-upnp-org:metadata-1-0/upnp/ <item id=1182 parentID=40 restricted=1> <title>Hot
I have an XML response that I'd like to bind and display to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.