Benefits of Using XML | Difference in XML Schema with DTD | Web Technology

Download our Android App from Google Play Store and start reading Reference Notes Offline.

benefits of XMLBenefits of Extensible Markup Language (XML),
Difference of XML Schema with DTD,
Web Technologies Notes| Sixth Semester,
BSc.CSIT | Tribhuvan University (TU)

Benefits of using Extensible Markup Language (XML)
XML is a markup language that defines a set of rules for encoding documents in a format that is both human readable and machine readable. The design goals of XML emphasize simplicity, generality, and usability across the internet. It is a textual data format with strong support via Unicode for different human languages. Due to it’s simplicity and other characteristics, it has several benefits to use and they are as follows;

  • Information coded in XML is easy to read, understand and it can be processed easily by computers.
  • Extendable: one can create own tags, or use tags created by others, that use the natural language of your domain.
  • Any application that can process XML can use your information, regardless of platform.
  • Supports Unicode, allowing almost any information written in any human language to be communicated.
  • Represents common computer science data structures: records, lists and trees.
  • Its self-documenting format describes structure and field names as well as specific values.
  • XML is heavily used as a format for document storage and processing, both online and offline.
  • It is based on international standards.
  • It can be updated incrementally.
  • It allows validation using schema language such as XSD and Schematron, which makes effective unit-testing, firewalls, acceptance testing, contractual specification and software construction easier.
  • The hierarchical structure is suitable for most types of documents.
  • Forward and backward compatibility are relatively easy to maintain despite changes in DTD or Schema.

Difference between XML Schema and DTD are as follows;

  • XML Schemas must be written in XML, but DTDs are not.
  • XML Schemas are namespace aware, but DTDs are not.
  • To allow inline definitions is the functionality of the DTD which is not available in the XML Schema.
  • DTDs are considered to be less powerful than XML Schema.
  • As compared to the DTD, the XML Schema is strongly typed.
  • Derived and built-in data types are available in the XML Schema but they are not available in DTDs

Write an XML DTD to describe “person” as an element and “Name, address, phone-no, and Age” as it’s attributes

<?xml version=”1.0” encoding=”utf-8”?>
<!DOCTYPE person [
<!ELEMENT person (name,address,phone-no,age)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT phone-no (#PCDATA)>
<!ELEMENT age (#PCDATA)>
]>
<person>
<name>Digvijay</name>
<address>Dhangadhi</address>
<phone-no>9811678933</phone-no>
<age>22</age>
</person>

(Visited 110 times, 1 visits today)

Posted By : Digvijay | Comment RSS | Category : Sixth Semester
Tag :

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

Wordpress DMCA
Community | Toolbar | Android App | Founder/Developer : Hari Prasad Chaudhary | CSIT Portal Manager : Digvijay Chaudhary