Prev: What is the difference between Memory Usage and Heap Usage in my JVM Metrics ?
Next: Statements before super()
From: Daniel Pitts on 9 Feb 2010 18:11 On 2/9/2010 7:58 AM, Roedy Green wrote: > What bothers me is I explained in the XSD considerable detail about > the structure of the document, but none of this knowledge is > automatically used in extracting data. It should bother you. Time to break out meta-programming skills. You can generate either the XSD from code, code from the XSD, or code+XSD from some other authoritative source! There may already be tools that do one or the other of this for you. I think I saw someone mention JAXB (never used it, so don't know about it). -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
From: Roedy Green on 10 Feb 2010 13:48
On Tue, 9 Feb 2010 10:47:10 -0800, "Mike Schilling" <mscottschilling(a)hotmail.com> wrote, quoted or indirectly quoted someone who said : >As I said, use JAXB to generate a class from the schema. Many web service >toolkits can do this too (e.g. Axis), but as far as I know, they need a WSDL >to start from. Thanks for the tip. It turned out to be much easier than the tutorial lead me to expect. If you ignore the generated code, the code is much simpler than DOM. It gets the types right, including enums. I am now using it to extract data about posters that I put on my home page. I wrote up an overview on JAXB at http://mindprod.com/jgloss/jaxb.html The tool that make this feasible was Stylus Studio which generated a first cut at an XSD given a sample XML file. I then polished it a bit and tweaked it to get JAXB to generate better Java. -- Roedy Green Canadian Mind Products http://mindprod.com Every compilable program in a sense works. The problem is with your unrealistic expections on what it will do. |