XML
By Elizabeth Wiley
eXtensible Markup Language
 Became a W3C recommendation in 1998

 Subset of SGML (Standard Generalized Markup
  Language)

 Describes a class of data objects called XML documents

 Metalanguage (language for describing other
  languages)

 Tags are not predefined, designed to be self-prescriptive

“XML is a software- and hardware-dependent tool for
carrying information.”4
The goal of XML:                Why?
To enable generic SGML to be     Browsers never allowed
served, received, and             SGML
processed on the Web in a
way that is not possible with    HTML is easy to corrupt or
                                  break
HTML. XML has been designed
to operate with both SGML          Widespread
and HTML.                          Held back
                                     development

                                 XML fixes that by creating
                                  compulsory rules
The Basics

 XML documents consist entirely of characters from
  Unicode (not all Unicode characters are included).

 Characters that make up XML are divided into markup
  and content.

 Unicode character sets are encoded into bytes for
  storage or transmission.

 The processor analyses the markup and passes structured
  information to an application.
XML Document

 Begins with XML declaration and document type
  declaration

 Followed by Document Instance, containing root
  element (start/end tags) and elements enclosing the
  data content (text) and any attributes („name=“value”‟
  pairs)

 Documents can be simple, with straightforward nested
  markup, or more complicated with Schema or DTD
  (describe structure of the document)
Schema and DTD (Document Type Definition)

 Define the allowed parts of an XML document:
   The elements and attributes that can appear
      Data types, default and fixed values
   Identify child elements, and their order and number
   Whether an element is empty or includes text

 Schemas are the successors of DTDs
   Extensible to future additions, richer and more
    powerful, support data types and namespaces, written in
    XML
   XML Schema became a W3C recommendation in 2001
Stylesheets (CSS and XMLT)

 Transform XML into HTML

 Allow for document management benefits of XML, but
  readers don‟t need XML smarts in their browsers

 XMLT is an document processing language that uses XML
  source code

 Declares rules for processor to use when interpreting XML
  document
Browsers

Current versions of Internet Explorer, Firefox, Safari,
Chrome, and Opera all support XML with CSS or
XSLT stylesheets.

Does not work with any versions of Netscape, IE
6.0 or earlier, or early versions of Mozilla.
The Difference

XML                           HMTL
 Designed to transport and    Designed to display data
  store data
                               Focuses on how data looks
 Focuses on what data is



XHTML is “a reformulation of HTML 4 in XML
1.0”
HTML5
 Intended to include HTML and XHTML

 XHTML5 is an XML serialization of HTML5, meaning the
  data structure or object state is converted into a form
  that can be stored.
Sources

1   http://xml.silmaril.ie/

2   http://xml.coverpages.org/xml.html

3   http://en.wikipedia.org/wiki/XML

4   http://www.w3schools.com/xml/xml_whatis.asp

5   http://www.w3schools.com/Schema/schema_intro.asp

6   http://en.wikipedia.org/wiki/Serialization

7   http://en.wikipedia.org/wiki/HTML5#XHTML5

XML

  • 1.
  • 2.
    eXtensible Markup Language Became a W3C recommendation in 1998  Subset of SGML (Standard Generalized Markup Language)  Describes a class of data objects called XML documents  Metalanguage (language for describing other languages)  Tags are not predefined, designed to be self-prescriptive “XML is a software- and hardware-dependent tool for carrying information.”4
  • 3.
    The goal ofXML: Why? To enable generic SGML to be  Browsers never allowed served, received, and SGML processed on the Web in a way that is not possible with  HTML is easy to corrupt or break HTML. XML has been designed to operate with both SGML  Widespread and HTML.  Held back development  XML fixes that by creating compulsory rules
  • 4.
    The Basics  XMLdocuments consist entirely of characters from Unicode (not all Unicode characters are included).  Characters that make up XML are divided into markup and content.  Unicode character sets are encoded into bytes for storage or transmission.  The processor analyses the markup and passes structured information to an application.
  • 5.
    XML Document  Beginswith XML declaration and document type declaration  Followed by Document Instance, containing root element (start/end tags) and elements enclosing the data content (text) and any attributes („name=“value”‟ pairs)  Documents can be simple, with straightforward nested markup, or more complicated with Schema or DTD (describe structure of the document)
  • 6.
    Schema and DTD(Document Type Definition)  Define the allowed parts of an XML document:  The elements and attributes that can appear  Data types, default and fixed values  Identify child elements, and their order and number  Whether an element is empty or includes text  Schemas are the successors of DTDs  Extensible to future additions, richer and more powerful, support data types and namespaces, written in XML  XML Schema became a W3C recommendation in 2001
  • 7.
    Stylesheets (CSS andXMLT)  Transform XML into HTML  Allow for document management benefits of XML, but readers don‟t need XML smarts in their browsers  XMLT is an document processing language that uses XML source code  Declares rules for processor to use when interpreting XML document
  • 8.
    Browsers Current versions ofInternet Explorer, Firefox, Safari, Chrome, and Opera all support XML with CSS or XSLT stylesheets. Does not work with any versions of Netscape, IE 6.0 or earlier, or early versions of Mozilla.
  • 9.
    The Difference XML HMTL  Designed to transport and  Designed to display data store data  Focuses on how data looks  Focuses on what data is XHTML is “a reformulation of HTML 4 in XML 1.0”
  • 10.
    HTML5  Intended toinclude HTML and XHTML  XHTML5 is an XML serialization of HTML5, meaning the data structure or object state is converted into a form that can be stored.
  • 11.
    Sources 1 http://xml.silmaril.ie/ 2 http://xml.coverpages.org/xml.html 3 http://en.wikipedia.org/wiki/XML 4 http://www.w3schools.com/xml/xml_whatis.asp 5 http://www.w3schools.com/Schema/schema_intro.asp 6 http://en.wikipedia.org/wiki/Serialization 7 http://en.wikipedia.org/wiki/HTML5#XHTML5