This post originated from an RSS feed registered with Java Buzz
by Norman Richards.
Original Post: Annoyed by the J2EE 1.4 use of XML schema
Feed Title: Orb [norman richards]
Feed URL: http://members.capmac.org/~orb/blog.cgi/tech/java?flav=rss
Feed Description: Monkey number 312,978,199
Is anyone else annoyed by the use of XML schema for J2EE 1.4 deployment descriptors? This has caused me a lot of pain in doing J2EE development. Sure XML schema can express constraints that aren't possible in a DTD, but I find the price of human readability too much to pay
The nice thing about J2EE 1.3 DTDs is that you can read them. If you want to know what elements go where you can look at the DTD and find out. With the J2EE 1.4 schemas you can't really do that. Sure you can load it up in a schema tool and figure it out, and your editor can provide you some context sensitive help to sort things out. (all things you can do with a DTD) But, I don't like being forced
to do that because the schema language was so poorly designed that it can't be
used without a tool.
What's worse is that many of the tools I have that support schemas don't seem to like the J2EE schemas. I don't know if it is the tools or if the schemas aren't done well, but I often see complaints like java-typeType being declared twice (in ejb-jar_2_1.xsd and j2ee_1_4.xsd) when trying to work with the J2EE schemas.
I guess I should be grateful for having a more expressive
language than traditional DTDs, but I honestly never had a problem with
needing more complex validation of the text inside the elements. I'm sure having
an XML schema instead of a DTD makes somebody's life better, but it doesn't do anything for me except make deployment descriptors even more of a pain to work
with. It makes me even more grateful to have XDoclet around so I don't have to mess with them.