I can see various advantages for schemas :
- They allow datatypes. you ca say an element is an int, a string, etc ...
It can be very useful to avoid many tests when using datas in a java (or
something else ...) program.
- They can define cardinality largely better than DTD, by precising
minOccurs and maxOccurs. In this sense, they are more precise.
- They are XML documents, are so, can be parsed or used as others XML datas
... you can, for an example, parse your schema in your application, or
manipulate it with your DOM tree.
- You can define with schemas optionnal elements ...
these are very importants advantages for schemas, I think, that may cause
schemas to be the future of DTD ...
Helen Farrell a écrit :
> What can Schemas do, that DTD's cannot?
> Coming from a non-programming background I found DTD's (design and
> interpretation) intuitive and easy to understand.
> Now, with all the discussions on Schemas, I find myself unable the grasp the
> concepts as easily. It seems when comparing the definition of an element,
> that Schemas seem to take five times as long as DTD's.
> What is the benefit of using Schemas?
> I thought the whole point of XML was to set standards, but to retain
> simplicity where possible. I don't feel that Schemas are readily understood
> by the majority of people.
> Helen Farrell
Fabien GRELLIER - Softeam Rennes
mailto:[log in to unmask]
Objecteering : votre atelier UML gratuit : http://www.softeam.fr
------- Think Object