XML
In this post, the basics of XML (eXtensible Markup Language) are discussed. XML is a language used to hold the meaning and store data in a format so that it can be changed into another type of document, such as another XML file with a different structure or could be a totally unrelated file such as a text file. It icould be used to separate the data away from HTML.
Some main features of XML are:
- it's plain text
- it supports data structures
- it has a strict format
- it is useful to swap data between different application.
The Key components of XML are Elements and Attributes. All these components have strict syntax with rules that must be followed. Elements must have a closing tag and the tags are case sensitive, also apart that elements must be nested correctly, XML documents must have a root element. Attributes must always be quoted.
DTD
Since XML is so strict in format, Document Type Definitions (DTDs) are used to create a template so that the document will follow the expected order and structure.
Task
The Task for this psot was to create an XML file for to keep the data about a student project: student name, student ID, project title, project category, abstract, date submitted. Try to use both elements and attributes to describe the data. Validate the XML using the W3Schools XML Validator. Create a DTD Schema for the XML file and validate the XML against the schema using the W3Schools DTD Validator.
Here is the created XML document with all the elements and attributes required with the proper nesting and structure.
This XML was now tested in the w3schools XML validator. At first the validator found some errors which concerned the case sensitiveness of the document. These were easily fixed and no errors were found in the next validation.
The DTD of the XML was created with every tag beginning with “!” and nested inside the tag “!DOCTYPE”
No comments:
Post a Comment