Questions tagged [streamingmarkupbuilder]

A builder class used for creating XML document markup. The implementation of this class uses a `StreamingMarkupWriter` to handle the output results.

A builder class used for creating XML document markup. The implementation of this class uses a StreamingMarkupWriter to handle the output results. The bind() method of StreamingMarkupBuilder class returns a Writable instance that may be used to stream the markup to a Writer, in addition to capturing the output in a String.

13 questions
2
votes
0 answers

Groovy XML: How to parse, modify and serialize the content of a GSP file. (org.xml.sax.SAXParseException, prefix not bound)

Before I ask this question I will provide some info on what I am actually trying to do: I need to refactor a large amount of GSP files in my grails project. After I tried writing my own groovy script for that -- and realizing that it is way too…
nst1nctz
  • 333
  • 3
  • 23
2
votes
1 answer

Calling a method from inside StreamingMarkupBuilder

I'm using Groovy's StreamingMarkupBuilder to generate XML dynamically based on the results of a few SQL queries. I'd like to call a method from inside of the closure but the markup builder tries to create an XML node using the method name. Here's an…
blacktide
  • 10,654
  • 8
  • 33
  • 53
2
votes
2 answers

Why does StreamingMarkupBuilder perform better than MarkupBuilder for writing large documents

I've read in several places that StreamingMarkupBuilder is better suited to writing large XML documents than MarkupBuilder. However, I've been unable to find a definitive answer as to why that is. Can someone please explain why…
Jeremy Jarrell
  • 661
  • 1
  • 11
  • 20
1
vote
1 answer

passing in args to a Closure for a StreamingMarkupBuilder

Groovy 2.4, Spring 5.3.13 Not having much luck using StreamingMarkupBuilder to create some XML, serialize it and print it public void createMsgToStreamOut( String strCreatedAt, String strEntity, String strIdNum, String strEvent) { def…
code_warrior
  • 77
  • 10
1
vote
1 answer

Groovy StreamingMarkupBuilder output XML separator

I'm currently using in my groovy script the StreamingMarkupBuilder to produce my output XMl. Works all pretty well but when I have multiple elements with the same name in the source message, do I have an option to add separatos?
Marco
  • 25
  • 2
  • 6
0
votes
1 answer

Building xml and merging CDATA xml using groovy

I have mule flow which stores the xml in session variable. I want this xml to be inserted in the xml which is generated in groovy. My session variable looks like #[sessionVars.shippingdetails] This session variable has…
Simbu
  • 766
  • 1
  • 12
  • 37
0
votes
1 answer

How to format data in when defining XML in groovy?

I'm quite new to Groovy and couldn't find the right way to format/edit data in groovy when defining xml. I'd like to format my date to some custom format but I can't call any method from inside this closure, so the following fails : def response =…
0
votes
0 answers

Groovy StreamingMarkupBuilder:: Evaluate before bind

I am generating XML using StreamingMarkupBuilder. I am trying to account for scenarios were there are errors in my data, resulting in NullPointerException. This is how my data is built up currently: def xml = new StreamingMarkupBuilder() ... def…
Giannis
  • 5,286
  • 15
  • 58
  • 113
0
votes
1 answer

Using String Variables inside StreamingMarkupBuilder().bind{} in Groovy

for the Below code : def writer = new StringWriter() writer = new StreamingMarkupBuilder().bind { Project(){MyTag('Help Me')} } println(writer.toString()) the output would be: Help Me Now if i have "MyTag('Help…
0
votes
1 answer

Add Newlines to Output from Groovy StreamingMarkupBuilder

I am creating a massive xml file in Groovy. I'm using StreamingMarkupBuilder because the regular MarkupBuilder runs me out of Java heap space. I'm looking for a way to insert newlines in the StreamingMarkupBuilder or to parse the stream as it is…
soccerjo
  • 23
  • 4
0
votes
1 answer

How to add dynamically node to XML in Groovy with the StreamingMarkupBuilder

I am trying to dynamically create an XML file with Groovy. I'm pleased with the simplicity everything works, but i am having a hard time understanding the whole mechanism behind closures and delegates. While it appears to be easy to add properties…
Florian Salihovic
  • 3,921
  • 2
  • 19
  • 26
-1
votes
2 answers

Build Xml with Groovy

I need to remove "tei:" from each tag. My original xml looks like this:
mpk
  • 1
  • 2
-4
votes
1 answer

Groovy xml dynamic coding

I wish to create a dynamic XML file using inputs from the user(say an invoice list). As an input the Groovy script taken in number of items and based on the user entry, inputs the attributes per Invoice. Could you please guide me on the block of…