Introduction
HTML mixes content data and makes it difficult to present the same data and standardize presentation across multiple sets of data. XML organize information into tree-like structures with each item of information representing a leaf. The advantage of using XML in preference to proprietary format is when information is structured. The XML is turned to standardize the representation of information in respective areas.
XML Document
- <?xml version = "1.0" encoding = "ISO-8859-1" ?>
- < starfleet >
- < title >
- Startship
- </ title>
- < starship name = "USS Enterprise" sn = "NCC-1701" >
- < class name = "Constitution" />
- < captain > Jack sparrow
- < /captain>
- </ starship>
- <starship name = "USS Enterprise" sn = "NCC-1701-D" >
- < class name = "Galaxy " />
- < captain> Jean </captain>
- < /starship>
- < /starfleet>
The above code has standard and the character set used in the document and tags are closed in ending tag and the tag reflect the logical structure of data. XML documents contain processing instructions for the application and comments and document type. To verify the validity of xml documents and to communicate their structure to others by possibility of specifying in a separate document. The main method used to specify document structures are the XML, DTD and XML schemes.
XML DTDs
DTD is developed for XML predecessor and standard generalized markup language and the syntax of the DTD is shown below. It defines the start fleet element consist of a title element and starship element. Attribute type has many possible values and enumeration of all strings available.
- <! ELEMENT starfleet ( title,starship*) >
- <! ELEMENT title (#PCDATA) >
- <! ELEMENT starshp (class , captain)>
- <! ATTLIST
- starship name CDATA #REQUIRED
- sn CDATA #REQUIRED >
- <! ELEMENT class EMPTY >
- <! ATTLIST class name CDATA #REQUIRED >
- <! ELEMENT captain (#PCDATA) >
XML Schemes
It is used to store, handle, and style schemes like an XML document. W3C describes the standardized XML schemes in three document and is complicated. The starfleet element has an attribute to contain other elements. When applied to attribute, default supplies the value of optional attribute and the fixed constraint forces an attribute value and define a vale in an XML document and must match a fixed value assigned in the schema.

Join the conversation! Your thoughts help the community grow.