Issue Details (XML | Word | Printable)

Key: GROOVY-775
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Paul King
Reporter: Wang Bin
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
groovy

MarkupBuilder works not the same as NodeBuilder

Created: 12/Mar/05 09:30 PM   Updated: 11/Oct/07 04:29 AM
Component/s: scriptom
Affects Version/s: 1.0-beta-10
Fix Version/s: 1.1-rc-1

Time Tracking:
Original Estimate: 2 hours
Original Estimate - 2 hours
Remaining Estimate: 2 hours
Remaining Estimate - 2 hours
Time Spent: Not Specified
Remaining Estimate - 2 hours


 Description  « Hide
writer = new java.io.StringWriter()
builder = new groovy.xml.MarkupBuilder(writer)
customers = builder.customers() {
acustomer = builder.cusomer(name:"John")
builder.setCurrent(acustomer)
builder.order()
}
println writer.toString()

/* the output is
<customers>
<customer name='John' />
<order />
</customers>
*/

But if I let builder be NodeBuilder. e.g.
builder = new groovy.util.NodeBuilder()

the logic of customers is like
<customers>
<customer name='John' >
<order/>
</customer>
</customers>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Wang Bin added a comment - 14/Mar/05 12:33 AM
maybe the component of this bug is JDK. But I don't know how to change the component. Even I don't know whether it is possible to modify the component

Paul King added a comment - 11/Oct/07 04:29 AM
The current implementation of MarkupBuilder cannot support this style of using its API. The supported style of usage just nests the inner elements as needed.