Tools to Generate XSD from Sample Instances

View: New views
4 Messages — Rating Filter:   Alert me  

Tools to Generate XSD from Sample Instances

by Tsao, Scott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am wondering if there are good tools that would enable (auto) generation of XML schema from multiple instances of sample XML document.
 
It seems to me that one should be able to specify certain parameters for the resulting schema, e.g., the design pattern [1] to be followed.
 
Any comments or suggestions?
 
 
 
Thanks,

Scott Tsao 曹壽國
Associate Technical Fellow
The Boeing Company


Parent Message unknown Re: Tools to Generate XSD from Sample Instances

by XMLSchema at XML4Pharma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
My good advice: don't.
 
or at least, do not expect too much of it.
If you do, you will still need to do a lot of manual work afterwoods improving your schema.
 
For example, if some attributes are enumerated, how do you know that ? And if you do, how are you sure you have all possible values in your schema ?
How do you know whether the minOccurs for a child element should be 0 or 1 ?
 
Essentially, automated generation can only be a very first step.
 
I have seen cases where a believe that XML-Schemas can be generated automatically, without any afterwork, has led to disaster.
For example, the HL7-v3 messages are auto-generated from UML diagrams. At least as far as I know, they are not improved after that by someone who has knowledge of  XML-Schema. The result is that the whole stuff is overcomplicated, illogical and even bad XML.
I can advice anyone that wishes to generate XML-Schemas to first learn XML-Schema.
 
Personally, I prefer to make a good model first (not using UML) and then write the XML-Schema by hand.
 
Best,
 
Jozef Aerts
XML4Pharma
 
----- Original Message -----
Sent: Tuesday, October 20, 2009 3:06 AM
Subject: Tools to Generate XSD from Sample Instances

I am wondering if there are good tools that would enable (auto) generation of XML schema from multiple instances of sample XML document.
 
It seems to me that one should be able to specify certain parameters for the resulting schema, e.g., the design pattern [1] to be followed.
 
Any comments or suggestions?
 
 
 
Thanks,

Scott Tsao 曹壽國
Associate Technical Fellow
The Boeing Company


RE: Tools to Generate XSD from Sample Instances

by Michael Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've had good results on this using Stylus Studio. It works from a single instance document, but you can always combine multiple instances into one before you start. There is some control over the design patterns it uses, but I generally find the default settings are quite usable. Of course you have to tidy up the generated schema by hand afterwards, for example to make intelligent decisions about when to use enumerations and patterns in your simple types, or when to impose a hierarchy of types or substitution groups, but I find it's often a good way of creating a first cut.
 


From: xmlschema-dev-request@... [mailto:xmlschema-dev-request@...] On Behalf Of Tsao, Scott
Sent: 20 October 2009 02:06
To: xmlschema-dev@...
Subject: Tools to Generate XSD from Sample Instances

I am wondering if there are good tools that would enable (auto) generation of XML schema from multiple instances of sample XML document.
 
It seems to me that one should be able to specify certain parameters for the resulting schema, e.g., the design pattern [1] to be followed.
 
Any comments or suggestions?
 
 
 
Thanks,

Scott Tsao 曹壽國
Associate Technical Fellow
The Boeing Company


Re: Tools to Generate XSD from Sample Instances

by George Cristian Bina-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Scott,

Trang can generate XML Schema from a set of XML files
http://code.google.com/p/jing-trang/

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Tsao, Scott wrote:

> I am wondering if there are good tools that would enable (auto)
> generation of XML schema from multiple instances of sample XML document.
>  
> It seems to me that one should be able to specify certain parameters for
> the resulting schema, e.g., the design pattern [1] to be followed.
>  
> Any comments or suggestions?
>  
> [1]
> http://developers.sun.com/jsenterprise/archive/nb_enterprise_pack/reference/techart/design_patterns.html
>  
>  
> Thanks,
>
> /Scott Tsao/ 曹壽國
> Associate Technical Fellow
> The Boeing Company
>