Validation

In the creation of a database, using a data model in conjunction with integrity constraints can ensure that the structure and content of the data meet the requirements. But how do you enforce that kind of control using XML, when your data is just text in hand-editable files? Fortunately, validating files and documents can ensure that data fits constraints. In this tutorial, you’ll learn what validation is, and you’ll learn how to check a document against a Document Type Definition (DTD) or an XML Schema document.

DTDs were originally defined in the XML 1.0 Recommendation and are a carryover from the original Standard Generalized Markup Language (SGML), the precursor to HTML. Their syntax is slightly different from XML, which is one drawback to using them. They also have limitations in how they can be used, which led developers to seek an alternative in the form of XML schemas. However, DTDs are still in use in a significant number of environments, so an understanding of them is important.

The primary alternative to DTDs is the XML Schema Recommendation, maintained by the World Wide Web Consortium (W3C). (Throughout the course of the tutorial, “XML Schema” should be considered synonymous with “W3C XML Schema.”) Schemas, which are also XML documents, provide a more familiar and more powerful environment in which to create the constraints on the data that can exist in an XML document.

By the end of this tutorial you will learn how to create both a DTD and an XML Schema document. You’ll also learn the concepts of using them to validate an XML document.

Go to- Certified XML Developer Tutorial
Share this post
[social_warfare]
Parameter Entities
External DTD

Get industry recognized certification – Contact us

keyboard_arrow_up