XML. Markup Language. Markup refers to anything put on a document which adds some special meaning or provides some extra information. Markup can be classified into three types 1. Stylistic Markup ( <font> <I> <B> .. ) 2. Structural Markup ( <H1><P><DIV> …)
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Markup Language Markup refers to anything put on a document which adds some special meaning or provides some extra information. Markup can be classified into three types 1. Stylistic Markup ( <font> <I> <B> .. ) 2. Structural Markup ( <H1><P><DIV> …) 3. Semantic Markup ( <TITLE> <META>..)
SGML Sgml is the first mark up language. It’s a powerful markup language but it is very complicated .
HTML & IT’s DRAWBACKS 1. HTML has a fixed tag set. 2. HTML is a presentation technology. 3. HTML is flat.( No Hierarchy) 4. High Traffic Volumes.
XML XML is the Extensible Markup Language which is designed to enable the use of SGML on the World Wide Web. XML is not a single predefined markup language : it’s a metalanguage - a language for describing other languages .
Advantages of XML 1. XML separates data and display 2. Create custom tags that relate to the content. 3. View the same data in different ways. 4. Less Traffic Volumes.
XML TYPES * Well Formed Documents. * Valid Documents
XML Document contains five classes of elements in it they are, 1. ELEMENTS 2. ENTITIES 3. COMMENTS 4. Processing Instructions 5. CDATA Sections XML Document
ELEMENTS XML document is made up of elements . Elements are made up of Start-Tag , content and a End Tag. <mytag> My First XML Tag</mytag> Start- Tag Character Data End- Tag ELEMENT
ENTITIES Entities are same as the #define statements. <!ENTITY entityname “some replacement text”> To refer a entity &entityname;
COMMENTS COMMENTS TAKE THE FOLLOWING GENERAL FORM <!-- A Comment --> Note: The String “--” is not allowed to occur within a comment
<!-- This is perfectly a legal comment spanning two lines --> <!-- Not Legal Comment <!-- Iam Inner --> Iam Outer--> Comment Examples
Processing Instructions Processing instructions (PIs) allow documents to contain instructions for applications. PIs are not part of the document's character data. SYNTAX <?NameofTargetApp Instructions for App?>
PI Examples • <?xml version=“1.0”?> • <?xml-stylesheet href=“student.xsl”?>
CDATA Sections A CDATA section is used in XML to shield a body of text from the attention of the XML processor. The first occurrence of “]]>” will terminate the CDATA section. CDATA sections cannot be nested. SYNTAX <![CDATA[ …………. ]]>
CDATA Section Example <Subject name=“HTML”> <Syntax> <![CDATA[ <HTML> <HEAD> <BODY> Hello World </BODY> </HEAD> </HTML> ]]> </Syntax> </Subject> IGNORED
XML DOCUMENT PROLOG DOCUMENT TYPE DECLARATION ROOT ELEMENT
The root element of an XML document is the element that contains all other elements in the document. The root element can be empty.(Not a useful XML document ) COMMENTS EMPTY ELEMENTS ELEMENTS PROCESSING INSTRUCTIONS ENTITY REFS (Not Parameter entities) CDATA SECTIONS
XML Parser Parser is an application that Validates an XML Document. There are two kinds of Parsers . Validating Parser. Non-Validating Parser.
Validating Parser Document Valid XML Parser Structure Rules (DTD) Invalid XML
Sample.xml <!DOCTYPE Students [ <!ELEMENT Students (Student)> <!ELEMENT Student ( Name,Age ) > <!ELEMENT Name (#PCDATA)> <!ELEMENT Age (#PCDATA)> ]> <Students> <Student> <Name>Ravi</Name> <Age>25</Age> </Student> </Students>
External Subset <!DOCTYPE ROOT SYSTEM “…”> Example <!DOCTYPE Students SYSTEM “Student.dtd”> Student.dtd ( a separate file ) <!ELEMENT Students (Student +)> <!ELEMENT Student (Name,Age)>
<!DOCTYPE Students SYSTEM “Address.dtd”[ <!ELEMENT Student ( Name,Age ,Address) > <!ELEMENT Name (#PCDATA)> <!ELEMENT Age (#PCDATA)> ]> <Students> <Student> <Name>Ravi</Name> <Age>25</Age> <Address> <DoorNo>..</DoorNo> <Street>..</Street> <City>..</City> <PinCode>..</PinCode> </Address> </Student> </Students>
Address.dtd <!ELEMENT Address (DoorNo,Street,City,PinCode)> <!ELEMENT DoorNo (#PCDATA)> <!ELEMENT Street (#PCDATA)> <!ELEMENT City (#PCDATA)> <!ELEMENT PinCode (#PCDATA)>
Element Type declarations Elements can contain other elements or character data. SYNTAX <!ELEMENT elmt_name content_spec> <!ELEMENT elmt_name (content_model) >
An element declared as ANY can contain any mixture of character - data and other elements as long as the elements have been declared in the DTD. Example <!ELEMENT BODY ANY> <BODY> <BODY> <BODY> some Text<elements><elements> </BODY> </BODY> some text </BODY>
<!ELEMENT Name ANY> <Name> <Fname>..</Fname> <Sname>..</Sname> </Name> OR <Name>..</Name>
Sample.xml <! DOCTYPE Students [ <!ELEMENT Student ( Name,Age ) > <!ELEMENT Name (#PCDATA)> <!ELEMENT Age (#PCDATA)> ]> <Students> <Student> <Name>Ravi</Name> <Age>25</Age> </Student> </Students>
Connexion au compte
Connectez-vous pour publier votre contenu sur SlideServe.