Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML Extensible Markup Language

Similar presentations


Presentation on theme: "XML Extensible Markup Language"— Presentation transcript:

1 XML Extensible Markup Language

2 XML The World Wide Web Consortium's (W3C's) XML Working Group developed XML (Extensible Markup Language), which is derived from Standard Generalized Markup Language (SGML), in 1996. XML is for electronic data exchange and storage. A widely supported open technology (i.e., nonproprietary) A language used to create other markup languages to describe data in a structured manner.

3 What is XML? XML is the Extensible Markup Language.
Language for creating markup languages Mathematical formulas Molecular structure of chemicals Music Recipes Create new tags Used for Storing Data in structured manner. Not a Formatting Language. Describes data of virtually any type. Not just for Web pages. Defined by W3C to be application and vender neutral in

4 XML describes structure and semantics, not formatting
XML documents contain only data and Structure markups, Not formatting. Formatting can be added with: a browser that knows how to render these knew marked-up data. a style sheet (css). an Extensible Stylesheet Language (XSL).

5 Article.xml XML declaration. Element article is the root element.
1 <?xml version = "1.0"?> 2 3 <!-- Fig. 20.1: article.xml > 4 <!-- Article structured with XML --> 5 6 <article> 7 <title>Simple XML</title> 9 <date>September 19, 2001</date> 11 <author> <firstName>Tem</firstName> <lastName>Nieto</lastName> </author> 16 <summary>XML is pretty easy.</summary> 18 <content>Once you have mastered XHTML, XML is easily learned. You must remember that XML is not for displaying information but for managing information. </content> 23 24 </article> XML declaration. Article.xml Element article is the root element. Elements title, date, author, summary and content are child elements of article.

6 Article.xml 1 <?xml version = "1.0"?> 2
3 <!-- Fig. 20.1: article.xml > 4 <!-- Article structured with XML --> 5 <?xml-stylesheet type="text/css" href="article.css"?> 6 <article> 7 <title>Simple XML</title> 9 <date>September 19, 2001</date> 11 <author> <firstName>Tem</firstName> <lastName>Nieto</lastName> </author> 16 <summary>XML is pretty easy.</summary> 18 <content>Once you have mastered XHTML, XML is easily learned. You must remember that XML is not for displaying information but for managing information. </content> 23 24 </article> Article.xml

7 Rendering XML documents using CSS “article.css”
title { display: block; font-family: Helvetica, Arial, sans; font-size: 32pt; font-weight: bold; text-align: center} date { font-family: New York, Times New Roman, serif; font-size: 24pt; background-color: white; color: green; display: block } author { font-family: New York, Times New Roman, serif; font-size: 14pt; color: black; content { font-family: courier; color: blue }

8 Article.xml 1 <?xml version = "1.0"?> 2
3 <!-- Fig. 20.1: article.xml > 4 <!-- Article structured with XML --> 5 <?xml-stylesheet type="text/css" href="article.xsl"?> 6 <article> 7 <title>Simple XML</title> 9 <date>September 19, 2001</date> 11 <author> <firstName>Tem</firstName> <lastName>Nieto</lastName> </author> 16 <summary>XML is pretty easy.</summary> 18 <content>Once you have mastered XHTML, XML is easily learned. You must remember that XML is not for displaying information but for managing information. </content> 23 24 </article> Article.xml

9 Rendering XML documents using XSL “article.xsl”
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl=" <xsl:template match="/"> <html> <body> <h1> <font color="RED"> <xsl:value-of select="article"/> </font> </h1> </body> </html> </xsl:template> </xsl:stylesheet>

10 Create Markup XML permits document authors to create markup for virtually any type of information. This extensibility enables document authors to create entirely new markup languages for describing specific types of data, including mathematical formulas, chemical molecular structures, music, recipes, etc. Some XML-based markup languages include: XHTML (Chapters 4 and 5), MathML (for mathematics), VoiceXMLTM (for speech), SMILTM (Synchronous Multimedia Integration Language-for multimedia presentations), CML (Chemical Markup Language-for chemistry) and XBRL (Extensible Business Reporting Language-for financial data exchange).

11 Rendering: http://www.xml.com/style/
IE Amaya FO

12 XML Parser Processing an XML document requires a software program called an XML parser (or an XML processor). Most XML parsers are available at no charge and for a variety of programming languages (such as Java, python, C++, etc.). Parsers check an XML document's syntax and enable software programs to process marked-up data. XML parsers can support the Document Object Model (DOM) or the Simple API for XML (SAX).

13 DOM-based parsers DOM-based parsers build tree structures containing XML document data in memory. DOM-based parsers enable software programs to manipulate data in an XML document.

14 SAX-based parsers SAX-based parsers process XML documents and generate events when the parser encounters tags, text, comments, etc. These events contain data from the XML document. Software programs can "listen" for these events to obtain data from the XML document. Several Independent Software Vendors have developed XML parsers, which can be found at

15 XML document's structure
An XML document optionally can reference a document that defines that XML document's structure. This document is either a Document Type Definition (DTD) or a schema. When an XML document references a DTD or schema, some parsers (called validating parsers) can read the DTD/schema and check that the XML document follows the structure that the DTD/schema defines. Parsers that cannot check for document conformity against DTD/schemas are nonvalidating parsers.

16 valid , nonvalid, well formed
If the XML document conforms to the DTD/schema (i.e., the document has the appropriate structure), the XML document is valid. If the XML document does not conform to the DTD/schema, the XML document is nonvalid. If an XML parser (validating or non-validating) can process an XML document successfully, that XML document is well formed (i.e., it is syntactically correct). By definition, a valid XML document also is well-formed.

17 Microsoft XML Validator
us/samples/internet/xml/xml_validator/default.asp This sample web page allows you to enter in the URL of an XML document and both parse and validate that document.

18 CML Web based application – CML Molecules Viewer:

19 SVG Scalable Vector Graphics (SVG) is an exciting new XML-based language for Web graphics from the World Wide Web Consortium (W3C).

20 XML Basics XML FAQ: http://www.ibiblio.org/xml/slides/sd99east/basics/


Download ppt "XML Extensible Markup Language"

Similar presentations


Ads by Google