Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Parsing xml content in Groovy

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this is the right place to post this topic.
I am new in Groovy scripting and I hope to solicit your help/feedback.

Input:
<Raw>
<Param>fname=Hello&lname=World</Param>
</Raw>

Requirement:
1. Parse Param using & as identifier
2. Put parsed data to an array. e.g. array1:[fname=Hello, lname=World]
3. Loop into the array while creating an xml. Value element below, is dynamically generated based on the array content.
e.g <Info>
<Value name=fname>Hello</Value>
<Value name=lname>World</Value>
</Info>
5. Return the result/generated xml document as a string.

I hope you can help me with this case-study. Thank you in advance.
 
Saloon Keeper
Posts: 12603
273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

What have you tried? What are you stuck on?
 
knowledge is the difference between drudgery and strategic action -- tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic