How to generate DOM classes from schema (like StrutsConfig)?

I am trying to create a hierarchy of DomElements that represent a JPDL file (process definition language from JBoss jBPM).
I am looking at the StrutsAssistant for reference and all the classes in com.intellij.struts.dom have a comment that they are generated.

Is a tool for that available or do I have to handcode my classes?

P.S.
Would be nice if Peter Gromov's great article on XML processing would be linked from the plugin developer's documentation main web page:
http://www.jetbrains.com/idea/documentation/dom-rp.html
It took me quite a while to find it again, I only slightly remembered seeing it mentioned many some weeks ago, but did not need it then.

7 comments

There is an in-house tool from JB which will not be made available (last time I asked).

0

Which is a shame and severely reduces the API's attractiveness to use it for anything except trivial DTDs/schemas.

0

Actually a tool like that would be a good candidate for a new plugin :)

0

Sure, but then why should the community have to reinvent that wheel? IMHO a generator tool is a must-have for a serious XML binding framework. JB should just make it available - in one form or another.

0

I wouldn't even mind building my DOM-Model by hand (and I did it already) if there were not some really annoying bugs scheduled for "Demetra Minor Release " that make the whole API completely useless for my plugin.. e.g. http://www.jetbrains.net/jira/browse/IDEADEV-9977

0

Any news from JB about the tool ? Or maybe someone already reinvented the wheel ?

0

Maurice Montgénie wrote:

Any news from JB about the tool ? Or maybe someone already reinvented the wheel ?


Here you are.
This tool is more like a "work in progress" than a "real" generator.
Nevertheless it handles all the J2EE/JavaEE, spring, hibernate XSDs & DTDs.

It have to be improved to support XSD/DTD features it doesn't know and
everyone is welcome to do this. You can modify/improve the "generator"
part as well to generate the required code.

The bundle contains sample scripts to generate spring model by dtd and XSDs.

PS Please, add xercesImpl.jar from Xerces 2.8.1 to the lib folder.
It is too big for the newsgroup.

Luck :)
Gregory Shrago



Attachment(s):
DomModelGenerator.jar
0

Please sign in to leave a comment.