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
0 answers

Why is it working fine locally and the server getting groovy.util.slurpersupport.Attributes cannot be cast to java.util.Map error?

Why does it work fine locally, and when uploading to the server, the groovy.util.slurpersupport.Attributes cannot be cast to java.util.Map error occurs? How do I fix it? import groovy.json.JsonSlurper import groovy.sql.Sql import…
Ekz0
  • 63
  • 1
  • 8
0
votes
1 answer

Why is the text displayed if the tag is missing in the xml?

You need to read the xml and display only those values where there are INNYL or INNFL tags. But if I do not have any of them in the "Document" or it is empty, then the output is: INNYL INNFL Why is that? I need nothing to be displayed in this case,…
Ekz0
  • 63
  • 1
  • 8
0
votes
0 answers

XMLSlurper Groovy -

Is it possible with XLMSlurper to output all the text below a node without losing the tags?

text text text strong

I want to practically extract the text inside the DIV1 tag without losing the…
0
votes
2 answers

extract element value with XmlSlurper using groovy script

I have a input xml like below where I want to extract 'Maker' value and pass it to an element:-
John
  • 105
  • 9
0
votes
1 answer

Filter xml element removing duplicated child node with groovy xml slurper

I need to filter an xml list so to get all the "element" with no duplicates. Input: A 1 B 2
0
votes
1 answer

xmlslurper remove node from xml by child value

I need to remove the node "row" from my XML below if the value of "field1" is equal to a certain value. AAA 001
0
votes
1 answer

XmlSlurper doesn't return value

i'm using XmlSlurper to get a value from an XML-Response. I copied the response to local String here for easier testing purposes. I need to get the value from jobReqId which is 506 in this case. If I use println: jobReqId.name(); i'm getting the…
Sebi
  • 3,879
  • 2
  • 35
  • 62
0
votes
1 answer

API xml response looping and extract all the element values - Groovy

Below is the snapshot of my API XML response SEB B.A. SEB?? I want to extract all the PlaintiffName under the Plaintiff node. Code: String…
Prabu
  • 3,550
  • 9
  • 44
  • 85
0
votes
1 answer

How to get the value of XML attribute using groovy

I am trying to fetchthe value of attribute xmlns inside CanOfferProductResponse tag in Groovy below is my XML-
Sachin Singh
  • 383
  • 3
  • 10
0
votes
1 answer

Groovy get xml tags attribute value

I am trying to get the value of the attribute IntegratorCode AND ProductType using groovy.
Sachin Singh
  • 383
  • 3
  • 10
0
votes
1 answer

Groovy how to convert xml file to a single line string

I have an XML request in the form of a file, that I want to add to a taurus yaml file. The yaml file requires a single line string. I have it working with a json file by doing this; strMessage=getFileContents("request.json"); //Use a…
Slimy43
  • 341
  • 4
  • 17
0
votes
1 answer

how to traverse inside a xml node and check for an attribute value?

I have this xml, i took it in xml a GPathResult object how can I get Microsoft(R) Windows(R) Server 2003 Enterprise x64 Edition based on checking with the field value as OS Name using groovy xml slurping
AabinGunz
  • 12,109
  • 54
  • 146
  • 218
0
votes
1 answer

org.xml.sax.SAXParseException The prefix "a" for element "a:IDType" is not bound in groovy script

I am trying to replace some node in my existing soap envelope using groovy script in SOAPUI tool Below is my exting envelop
Prasad Parab
  • 437
  • 1
  • 7
  • 26
0
votes
1 answer

groovy xmlSlurper check more fields within same level

I have this xml. E0000
0
votes
0 answers

How to get soapUI config settings using Groovy

I am trying to iterate over the list of SQL Security Scan strings available by default from soapUI. (it's a workaround due to using soapUI community version) I can get the Security Scan Config object successfully, but I'm just having an XML parsing…
Guy
  • 666
  • 1
  • 10
  • 34