Issue Details (XML | Word | Printable)

Key: GROOVY-1517
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: Paul King
Votes: 0
Watchers: 1
Operations

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

DomToGroovy outputs builder code not compatible with MarkupBuilder

Created: 04/Oct/06 03:20 AM   Updated: 11/Oct/07 07:48 AM
Component/s: XML Processing
Affects Version/s: 1.0-JSR-6
Fix Version/s: 1.1-rc-1

Time Tracking:
Not Specified

File Attachments: 1. Text File DomToGroovy.patch (2 kB)



 Description  « Hide
If you feed in xml/xhtml into DomToGroovy which looks something like:

<a href="http://groovy.codehaus.org">Groovy</a>

It outputs something like:

a(href:'http://groovy.codehaus.org') ["Groovy"]

but MarkupBuilder seems to currently only like:

a(href:'http://groovy.codehaus.org', "Groovy")

I think we should change DomToGroovy to output the currently supported builder notation.

There is a DomToGroovyTest.groovy file which checks that the currently incompatible behaviour is in place. Perhaps it should be modified to always pass its output back into MarkupBuilder and perhaps (with some XMLUnit magic) check that it produces what was fed in in the first place.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King added a comment - 08/Oct/06 04:40 AM
Attached patch and testcase enhancement make DomToGroovy consistent with current MarkupBuilder

Paul King added a comment - 12/May/07 02:27 AM
Mostly working now. Reducing prioriity.

Paul King added a comment - 11/Oct/07 07:48 AM
Now has the ability to run like this:

java -cp %GROOVY_CLASSPATH% org.codehaus.groovy.tools.xml.DomToGroovy infile.xml [outfile.groovy]

Also now uses StreamingMarkupBuilder.

Seemed to roundtrip: pom.xml, build.xml, config\checkstyle\checkstyle-frames.xsl