Sie sind auf Seite 1von 21

Presented by

Guide

Year

started :- 1996 Editors :-Tim Bray, Jean Paoli,Francois Yergeau, John Cowan Filename extension :- .xml Developed by :- World Wide Web Consortium Type of format :- Markup Language Extended from :-(SGML) Standard Generalized Markup Language

XML

is a markup language much like HTML XML tags are not predefined. You must define your own tags XML is designed to be self-descriptive Based on Standard Generalized Markup Language (SGML)

XML XML

1.0 (November 26, 2008) 1.1 (August 16, 2006)

XML

Separates Data from HTML XML Simplifies Data Sharing XML Simplifies Data Transport XML is Used to Create New Internet Languages

An

XML element is made up of a start tag, an end tag, and data in between. Example: <director> Matthew Dunn </director> XML tags are case-sensitive: <CITY> <City> <city> XML can abbreviate empty elements, for example: <married> </married> can be abbreviated to <married/>

An

attribute is a name-value pair separated by an equal sign (=). Example: <City ZIP=94608> Emeryville </City> Attributes are used to attach additional, secondary information to an element.

basic XML document is an XML element that can, but might not, include nested XML elements. Example:
<books> <book isbn=123> <title> Core Java</title> <author> Balguruswami </author> </book> </books>

<BOOKS> <book id=123 loc=library> <author>Hull</author> <title>California</title> <year> 1995 </year> </book> <article id=555 ref=123> <author>Su</author> <title> Purdue</title> </article> </BOOKS>

BOOKS

book loc=library
123

article ref
555

author title Hull

year

author

title

1995 Su California

Purdue

XML
Extensible set of tags Allows multiple output forms Requires matching end tags. <name> test</name Attributes must be quoted. It is case sensitive

HTML
Fixed set of tags Single presentation

Attributes missing end tag. <br>and<p> Attributes do not require quotes. It is not case sensitive.

The

oldest schema language for XML is the Document Type Definition(DTD), inherited from SGML. DTD serves as grammar for the underlying XML document. DTD has the form: <!DOCTYPE name [markup declaration]>

Consider

an XML document:

<db> <person> <name>Alan</name> <age>42</age> <email>agb@usa.net </email> </person> </db>

DTD

for it might be: <!DOCTYPE db [ <!ELEMENT db (person*)> <!ELEMENT person (name, age, email)> <!ELEMENT name (#PCDATA)> <!ELEMENT age (#PCDATA)> <!ELEMENT email (#PCDATA)> ]>

W3C

supports an XML-based alternative to DTD, called XML Schema. XML Schema, published as a W3C Recomdation in May 2001. XML Schema language, typically containing the "xsd XML Namespaces Prefix and stored with the ".xsd filename extension.

<xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element name="to" type="xs:string"/> <xs:element name="from" type="xs:string"/> <xs:element name="heading" type="xs:string"/> <xs:element name="body" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element>

XML

Namespaces provide a method to avoid element name conflicts. Namespaces are a way to specify which DTD defines a given tag. Namespace declaration: defines a label (prefix) for the namespace and associates it to the namespace identifier (URI) Syntax- xmlns:prefix="URI".

Example <table xmlns="http://www.w3schools.com/furnitur e"> <name>African Coffee Table</name> <width>80</width> <length>120</length> </table

XSD

(XML Schema) Xlink (XML Linking language)


DTD(Document

XHTML(Extesible

Type Defination)

HTML) XML DOM (XML Document Object Model) Xquary (XML Quary Language)

XML is suitable not only for Web pages, but also for printed documentation, application file formats, and data Interchange between applications.

Das könnte Ihnen auch gefallen