First of all i would like to distinguish betwenn XML Validation and XML well-formedness. XML well-formedness means that
QUOTE
an XML document is conforming to the basic XML Syntax
while XML Validation means that
QUOTE
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:
QUOTE
Why do we need validation if we already have the well-formedness?
. The answer is easy:
QUOTE
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.
QUOTE
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:
QUOTE
- 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.
QUOTE
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:
QUOTE
- 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.
QUOTE
Relax NG stands for Regular Language Description for XML Coree - New Generation and it was developed by OASIS:
http://www.oasis-open.org/committess/tc_ho...abbrev=relax-ng

What are the features of Relax NG:
QUOTE
- 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://72.14.207.104/search?q=cache:PP0W22...or+DTD%22&hl=en

 

 

 


Reply