Author Login
Post Reply
Hi I would like to add a kind of XmlSlurper autocompletion feature to the GroovyEclipse.
In my mind I would like to have a kind of API with an annotation. Simply speaking imagine that I would like to write something like:
@XMLContract(url="urltomyschema.xsd", rootElement="rootNode")
def xmlresult = new XMLSluper().parse(CallToAService)
I mean that way that I know that my result will be an XML Structure compliant with a provided schema with the provided root element.
Then I would like to suggest completion based on the schema. If for example the rootNode contains three subnodes subnode1, subnode2 and subnode3, writing in the IDE
xmlresult. + Ctrl Space would suggest in addition to current Groovy results the three subnodes. My idea is to make XmlSlurper parsed object manipulation easier when schema is known.
Do you think such an extension could be valuable and interest other people ?
Since I started, I managed to visit Groovy AST structure and Java part (in may case) with JDT and also to parse XSD schema.
It starts to work and provide a pretty cool user experience for basic cases but I am not very satisfactory with the way I managed AST and also XSD analysis and would like the code to be improved.
My questions:
- Does this proposal make sense or be of interest for other people ?
- Has anybody some advices or pointers to navigate inside an XSD (like getting in a clean way attributes/children and so on) if possible using XSD plugin feature.
- Has anybody some advices and best practices to visit Groovy AST (i spent much time with the debugger to understand the structures while testing).
Thanks in advance.
Regards