Create XML schema from XML file

Suppose you want to create a xsd based on an “example.xml” structure.
After download and extract trang you can run it with:

java -jar /trang.jar example.xml example.xsd

The “example.xsd” file generated may not be exactly what you need, but most of the time it is a good starting point.

To validate a xml file, for instance “example.xml”, against an xsd file,
“example.xsd”, you can use the following command:

xmllint --schema form.xsd ~/form.xml

0 Responses to “Create XML schema from XML file”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s





Follow

Get every new post delivered to your Inbox.