Solved

How to create schema suitable for JAXB?

Posted on 2003-11-13
2
292 Views
Last Modified: 2013-11-19
I have Java objects containing data, that I want to Marshal/Unmarshal, to and from XML files using JAXB.  How would I go about creating schema(s) so I can then generate the "binding" classes from the schema?  My knowledge of XML and schema is very limited.

Note the JAXB tutorial says: "Representing XML content as Java objects involves two kinds of mappings: binding XML names to Java identifiers, and representing XML schemas as sets of Java classes."  Then it also says: "XML schema languages use XML names to label schema components, however this set of strings is much larger than the set of valid Java class, method, and constant identifiers. "  
Therefore, How does one know how to write proper schema in the first place???  

Are there any tools for generating proper schemas for the JAXB???
0
Comment
Question by:Taurus
2 Comments
 
LVL 15

Accepted Solution

by:
dualsoul earned 75 total points
ID: 9745205
hm...i can suggest you to use some tool, that automaticly generates XMLSchema from xml file:
 
1) XMLSpy (www.xmlspy.com ) - i think the best one for XMLEditing
2) some java IDE could do it, SunONE studio for instance
and so on :) you can easily findit through google

download one of then, generate Schema from your xml and use it with JAXB.
0
 
LVL 1

Assisted Solution

by:FesterWim
FesterWim earned 75 total points
ID: 9745875
XMLSpy is very handy. You can write a sample xml file and generate a XML Schema out of it. If you then tweak that generated schema a bit, you'll be on good way. That is how I did it when I started with JAXB. I didn't know anything about XML Schema either.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
pairstar challenge 2 42
use of cookies and regulations 1 52
create a gui in perl 3 45
@SBGen Method 3 25
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now