I am having some trouble understanding the constraints in XML as I am still a beginner in XML.
I am not exactly sure what would happen if not enough constraint descriptions are given to the XML Document Type Definition.
Please give me a few examples of the XML Document Type Definition with lacking constraint descriptions, and why the DTD cannot be used. Also, would this be the same case for the XML Schema (Or can the XML Schema overcome the lack of constraint descriptions)?
Edit1: I heard that trying to model a database and requiring a specific element to be numeric while all others are text is not possible in a XML DTD, thus not possible to constrain data within a text-only element to a specific type.
Is this true and why? And how might this actually look in a XML code? Would this be possible in the XML Schema?
If possible, please also give me an example similar to this where something cannot be expressed in a DTD due to constraint descriptions.
Edit2: Does the XML schema provides more concrete constraints than the XML DTD? For example, if there wasn't any constraints about data type when doing addition, and you try to add a string to an integer, would that cause problems? I would like to know the consequence of not putting appropriate constraints.