|
[Java]
XML Data Binding - bleh!
[
topping
]
In yet another wacky metadata project, I need to generate data bindings for XML Schemas themselves... the XSD of the XML Schema is the schema that I want to use to generate my bindings with. It would stand to reason that it is the most complicated XSD available, since it must be able to describe itself as well as all real-world uses that are known and loved. I tried to use jBind, JAXB, JAXME, and looked at Xerces and discounted a few others, failing at all of them. Here's the results of that. This is arguably an unfair test, because just about everyone seems to agree that the Schema XSD needs changes to be able to generate for it. The jBind author kindly noted that he has modified the Schema XSD and that I might look at that. In testing these projects, I actually tried both his XSD as well as the W3C document. I had a sense after looking at a few binding generators that Xerces would come the closest to being suitable, but it's the wrong paradigm for what I need. In this situation, the documents that I want to read are essentially M1 metamodels in MOF-speak, and I don't much care what happens at the M0 level because I'm creating M1 transforms. I could treat the M1 as M0, but the metadata that my M1 parse nodes are annotated with are Mn+1 -- the Schema XSD itself. Not much help. jBind is probably the most technologically promising, but from what I can gather, it's real focus is more like what you might imagine Castor blended with Jelly to be (and it's not runny...), but in my case what it generated was a bit too abstract. JAXB at least was kind enough to fail with a few hundred lines of output when given the task of compiling the Schema XSD; the most recent JAXME binaries I could download simply threw a NPE. Neither JAX* generated a single line of code. So in the end, I'm back where I started, writing the parser using XStream. Post a comment
|