tags:

views:

34

answers:

3

Hi All,

I have been assigned to create a XSD schema for a proposed XML. i know what tables will be involved and what will be required fields which we always going to expect in the XML as well as optional. I am very new to XSD and don't know where to and how to start.Can any one suggest me how to proceed so that i can start exploring something as currently i am on ground zero with the requirement.

Thanks in advance Umesh

+3  A: 

Best place to start off when you are at ground zero is w3schools -

http://www.w3schools.com/schema/schema_example.asp

Check this tutorial for beginners, looks good to me -

http://www.codeguru.com/java/article.php/c13529

Sachin Shanbhag
Sachin Thanks i was just looking at w3schools tutorials
@user471607 - I think, first you need to know what the xsd really means, once you have that knowledge, then you can go for editors or tools for generating xsd for your xml like others have suggested.
Sachin Shanbhag
+1 agree with you thats why i am not loking for any tools rigth now
I would also recommend the [XML Schema Primer](http://www.w3.org/TR/xmlschema-0/).
Matt Solnit
A: 

The simplest way to start would be download a good XML editor, like XMLSpy and create schema visually. Altova has a free 30-day evaluation for their product, that should be enough for you to crank a first draft of your schema.

Eugene Kuleshov
@Eugene:Is using editor and all things will help me since i am new and learning some basic will be my natural urge and i beieve editor will allow little window to learn
Right, but you can use a visual editor to build a good structure and then read the source. With XSD verbosity it is really pointless to write schema by hand.
Eugene Kuleshov
A: 

Depending on what you application is going to do, you might be able to generate one. For example you mention that your data is coming from (database) tables. If you intend to interact with the database using JPA entities, then you could use JAXB to generate an XML schema from the entity classes:

If you are using other tools to interact with the database, they may also have schema generation utilities.

Blaise Doughan
@Blaise we need to import an XML into our system its a Product XML.We will get this XML from third part so we need to provide them XSD and also need the same XSD to validate the XML. I hope i am able to put my question in better way
Sachin's advice is probably best, first get a good understanding on XSD. Then when it comes time to defining the XML schema be sure to factor in the tooling that will be used to process the XML. If you had intended to use POJOs to represent the data, JAXB may have given you a means to define the schema.
Blaise Doughan