Jump to content
xisto Community
Sign in to follow this  
mizako

Xml Validation XML Validation- DTD XML Schema Relax NG

Recommended Posts

First of all i would like to distinguish betwenn XML Validation and XML well-formedness. XML well-formedness means that

an XML document is conforming to the basic XML Syntax

while XML Validation means that

an XML document is conforming to a particular Schema. Let say XML Schema, DTD or Relax NG

. The first question that can come into your mind is:

Why do we need validation if we already have the well-formedness?

. The answer is easy:

validation protects the system from data it cannot handle and enforce a contract between applications on the Web

. That it is to say that valid way for exchanging data is provided.

There are three different levels of validation:

- Validation of the markup (the content model validity)

- Validation of the values (datatypes)

- Validation of integrity.
So, lets begin with the DTDs. This was the first approach to provide XML validation and comes from the DTDs used with SGML. Nowadays there are a lot of applictions which XML data is validated with DTDs but DTDs will be deprecated due to its limitations:

- DTD is not written in XML so it is needed a separate parser.

- Problems with namespaces, i.e., combining XML applications

- Poor support for datatypes, no integers, string, etc.

- Syntactical limitations.

To avoid all this limitations the W3C developed the (XML Schema.

A particular XML Schema is a definition of a number of elements and attributes. Each element or attribute has a name (tag-name) and a type. These types can be complexed and simple types. The complex types are used to define the content model while the simple types are used to define datatypes of elements and attributes.

XML Schema fullfils almost all the limitations of the DTDs. Specially the poor support of datatypes. But there are some critics to these schema:

- It is considered complex

- It is not that flexible (structurely)

- Not that intuitive (types-based not structure-based)

- Long time needed to learn all the features

- Tool supported not that good as for DTD (But it is fastly growing).

With the intention of provide a easier Schema language Relax NG was born.

Relax NG stands for Regular Language Description for XML Coree - New Generation and it was developed by OASIS:

http://forums.xisto.com/no_longer_exists/

What are the features of Relax NG:

- Complete separation between structure (the content model) and datatypes (XML Schema did not separate)

- The structure is defined by means of patterns

- Similar to regular expression patterns

- Reusing of patterns is possible

-  Very intuitive!!!!

So basically Relax NG is more flexilbe, more intuitive and easier to learn than XML Schema but the backward is that is not that good supported as DTD or even XML Schema.

 

Notice from snlildude87:
You do a very good job of incorporating another source into your post, but you still need to quote whatever is not your words, and provide a link to the source: http://forums.xisto.com/no_longer_exists/
Edited by snlildude87 (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.