XML - Extensible Markup Language
XML(Extensible Markup Language) is considered extensible because it is not a fixed format like HTML. It is designed to enable the use of SGML(Standard Generalized Markup Language) on the World Wide Web.
XML itself is not a single markup language: it is a metalanguage that lets you design your own markup language. A regular markup language defines a way to describe information in a certain class of documents (eg HTML). XML lets you define your own customized markup languages for many classes of document. It can do this because it is written in SGML, the international standard metalanguage for markup languages.
You can use XML to describe any type of data. XML can also be used to create new element types.
XML is:
- Extensible - flexibility
- Portable
- Structured
- Descriptive
Differences between HTML and XML
- XML is case sensitive
- Every tag must be paired with a close tag. Tags that don't normally have a close tag, must terminate with a forward slash, i.e. <br/>
- All attributes must be enclosed in single or double quotes.
Features of XML
- In XML, you can create new element types.
- Tags are used to describe element types.
- The root element contains all other elements in the document.
- A container element contains sub-elements.
- DTD files define the grammatical rules for a document. A DTD is not required for an XML document, but is recommended for uniformity of documents. The W3C defines a DTD as "a collection of declarations that, as a collection, defines the legal structure, elements, and attributes that are available for use in a document that complies to the DTD."
- XML documents end in the .xml extension while Document Type Definitions (DTD) documents end in the .dtd extension.
- XML parser (processor) combines an XML document with its DTD. IE 5.0 has a built-in XML processor = msxml. Netscape 6.0 has a built-in XML processor.
Features of Document Type Definitions
- !ELEMENT specifies the element that is being created. BNF rules are followed:
- + - means one or more occurrences
- * - means zero or more occurrences
- ? - means zero or one occurrence
- default is one occurrence
- !ATTLIST defines an attribute. #IMPLIED means that the attribute does not have a default value. CDATA means that the attirbute contains a string.
- #PCDATA specifies that the element can store parsed character data.
- EMPTY means that the element does not contain content.
- When an XML document is created, the DTD for the XML document is declared in a document type declaration at the top of the document.
- The XML document's content is validated by checking its markup against its DTD and reporting markup errors. You can validate HTML, XHTML, and CSS files by using the W3C's validator; an easy way is to include a link to http://validator.w3.org/check/referer in your document - click on it to validate the document.
Click here to return to Wayne's World's homepage:
written by Wayne Summers summers_wayne@ColumbusState.edu