Presentation is loading. Please wait.

Presentation is loading. Please wait.

Eugenia Fernandez IUPUI

Similar presentations


Presentation on theme: "Eugenia Fernandez IUPUI"— Presentation transcript:

1 Eugenia Fernandez IUPUI
XML Validation Eugenia Fernandez IUPUI

2 Why Validate? One of the key benefits to using XML is the ability to exchange data between applications. This is possible only if the structure of the XML documents can be agreed upon and defined i.e., what the tags are and in which order they should appear. The format of an XML document can be specified in either a Document Type Definition (DTD) or an XML Schema.

3 XML Vocabularies A DTD or XML Schema essentially describes a vocabulary for a document. Industry groups are defining XML vocabularies for their specific industries, e.g., Microsoft’s BizTalk Financial Products Markup Language Health Level Seven Telecommunications Interchange Markup Wireless Markup Language For a more complete list, see XML Standards In Effect or In Process

4 DTD’s vs. Schemas Content Model Data types
DTD’s define a “closed” model – a document cannot contain elements not explicitly defined in the DTD Schemas define an “open” model – additional elements can be present without being declared in the schema Data types DTD’s are limited to alphanumeric text Schemas support multiple data types like string, numbers, dates and so on

5 DTD’s vs. Schemas, continued
Syntax DTD syntax is different from that of XML documents; many editors cannot process it Schemas use the same syntax as XML documents Extensibility & Application Schemas are extensible – can build custom schemas from standard ones following object-oriented concept of inheritance Multiple schemas can be used in one document and different schemas can be applied to different elements within one document Only one DTD can be attached per XML document.

6 What Can Be Validated: Structure
Elements What elements are recognized? What elements are optional/required? What are the relationships between elements? How many child elements are allowed? Is the sequence of child elements significant? If so, what is the correct sequence? What is the data type of each element?

7 What Can Be Validated: Structure
Attributes What attributes are recognized? What attributes are optional/required? What is the data type of each attribute? Is there a restricted set of values for an attribute?

8 What Can’t Be Validated: Semantics
What does each tag mean? Address can be used for postal address, address, or even a URL. Does my <address> tag mean the same as your <address> tag?

9 What Can’t Be Validated: Semantics Solutions
Define a different XML element for each type of address. Add an attribute to describe the address. <postal_address>101 Main St.</postal_address> <address type=“postal”>101 Main St.</address> <address

10 The End


Download ppt "Eugenia Fernandez IUPUI"

Similar presentations


Ads by Google