Questions tagged [xmlslurper]

XMLSlurper is a Groovy class that makes parsing and working with XML simpler than with Java.

You can read more here

241 questions
0
votes
2 answers

groovy rename node issue using xmlSlurper

i have a xml like below where i just need to rename the node name to another. c and i want to change it to c i need to do it using xmlSlurper so how do i do it? how can i do the node rename. Does…
Vik
  • 8,721
  • 27
  • 83
  • 168
0
votes
1 answer

SOAPUI Groovy parsing XML response and insert it into mysql database

Im a beginner in groovy and trying to parse XML and insert the resultant records into MySQL database Sample SOAP XML response
0
votes
1 answer

Find GPath exists in given XML document using Groovy

In Groovy given a GPath I want to find that the path exists in XML document. So that I can set a value for the node. I can use xmlslurper for parsing the document. GPath is a string path represented in slashes format.
Bharath Reddy
  • 301
  • 2
  • 4
  • 15
0
votes
0 answers

Groovy each immutability

From the following code snippet I tried, This runs into an infinite loop regardless of the fact that I mark the initial ds as immutable, and looping it with an each. What am I missing? - domObject.Whatever.'**'.findAll { it.name() == 'Node'…
dexter31
  • 31
  • 4
0
votes
0 answers

How to iterate all chidren nodes with a name GPathResults of Xmlslurpur In groovy

GPathResult res = new XmlSlurper().parseText(xml) ... ... res.order.children().findAll{it.name() == 'lineItems'}.each{it-> println 'Here I am printing'+ it.id } I am using as shown above to iterate all children with name 'lineItems' in…
Nomad
  • 751
  • 4
  • 13
  • 34
0
votes
1 answer

How to apply predicate to GPath when I am using XMLSlurper

lets say I have the following XML 29.01.2015 0102
jazzyekim
  • 101
  • 1
  • 10
0
votes
1 answer

groovy/XML: Replace a node by another one

I try to replace an XML node by another one by using XmlSlurper (or XmlParser). The original XML: ... name1 name2 name3 ... The list that contains the…
Jils
  • 783
  • 5
  • 12
  • 32
0
votes
1 answer

Parse RSS with groovy

I am trying to parse RSS feeds with groovy. I just wanted to extract the title and description tags' value. I used following code snippet to achieve this: rss = new XmlSlurper().parse(url) rss.channel.item.each { …
clever_bassi
  • 2,392
  • 2
  • 24
  • 43
0
votes
1 answer

replace XmlSlurper tag with arbitrary XML

I am trying to replace specific XmlSlurper tags with arbitrary XML strings. The best way I have managed to come up with to do this is: #!/usr/bin/env groovy import groovy.xml.StreamingMarkupBuilder def page=new XmlSlurper(new…
Миша Кошелев
  • 1,483
  • 1
  • 24
  • 41
0
votes
2 answers

XmlSlurper NodeChild that represents a body tag?

I would like to get a Groovy NodeChild that represents, e.g., a body tag. However, if I do html=new XmlSlurper().parseText(blah) I get html which is a NodeChild. However html.body is a NodeChildren tag, and I can't seem to get a NodeChild. Much…
Миша Кошелев
  • 1,483
  • 1
  • 24
  • 41
0
votes
1 answer

XmlSlurper/NekoHTML document fragment parsing - No HTML or BODY tags wanted

Dear All, I am trying to parse the following HTML fragment, and I would like to get the same fragment as output (without HTML and BODY tags). Is this possible? If so, how? Thank you Misha p.s. I am reading…
Миша Кошелев
  • 1,483
  • 1
  • 24
  • 41
0
votes
1 answer

How to extract data from SOAP-request in SOAP UI

I'm creating mock SOAP-response which should return data contained in SOAP-request. Please, find a request sample: SOAP-Request: ...
Eugene
  • 5,353
  • 6
  • 27
  • 37
0
votes
1 answer

Access attribute on node which has namespace

I have the xml I pasted in the post and I want to use groovy XmlSlurper to access node language with attribute xlink:href that is not null/empty. I read the xml with XmlSlurper in the following way: def node =…
ddelizia
  • 1,571
  • 5
  • 30
  • 54
0
votes
1 answer

How to PUT XmlSlurper back to REST with HttpBuilder

I'm trying to make GET and then PUT call on XML REST web service. I do it this way: @Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7') import groovyx.net.http.HTTPBuilder import static groovyx.net.http.ContentType.* import static…
0
votes
1 answer

How to remove nodes from an XML file

I want to remove some elements from an XML file using groovy, however this does not seem to work. Any ideas how to solve this? def DeploymentDescriptors = new…
user955732
  • 1,330
  • 3
  • 21
  • 48