Presentation is loading. Please wait.

Presentation is loading. Please wait.

E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language)  XML is a markup language for creating documents containing structured information.

Similar presentations


Presentation on theme: "E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language)  XML is a markup language for creating documents containing structured information."— Presentation transcript:

1 E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language)  XML is a markup language for creating documents containing structured information.  XML stands for eXtensible Markup Language.  Structured information contains content and what role the content plays.  Eg. content-audio, video etc  Role- heading, address etc.

2 E0262 – MIS – Multimedia Storage Techniques XML specifies neither tag set or semantics. Open language defines its own tags Based on the application domain, we need to define. Semantics defined by applications that process the documents. It is meant creating some content. It is not only meant for viewing on browser but has many application of XML. What ever is defined in XML, some API will help to extract the structured information from XML specification. Semantics can be defined by the application It is meta language that can describe markup language

3 E0262 – MIS – Multimedia Storage Techniques XML XML defines 3 specifications. 1. Basic XML specification(XML 1.0) Defines syntax of XML 2. XML pointer language (Xpointer) XML linking language (Xlink) To create hyperlinks. 3. XSL-Extensible style language Define style sheets.

4 E0262 – MIS – Multimedia Storage Techniques ---prolog How are you? I am fine ----empty Tags will be made based on application and person viewing it.

5 E0262 – MIS – Multimedia Storage Techniques Applications of XML * Cell Phones - XML data is sent to some cell phones. The data is then formatted by the specification of the cell phone software designer to display text or images, and even to play sounds! * File Converters - Many applications have been written to convert existing documents into the XML standard. An example is a PDF to XML converter. * VoiceXML - Converts XML documents into an audio format so that you can listen to an XML document.

6 E0262 – MIS – Multimedia Storage Techniques Internet Explorer 6.0 supports viewing XML files. You can download IE 6.0 from Microsoft's Website. Internet Explorer 6.0 has special color coding the make XML documents easier to read. Firefox XML Viewer: Firefox has some of the same features as Internet Explorer. You can download Mozilla's Firefox from Mozilla.com. Free XML Editors: There are many free XML editors available for download on the internet. Here are a few we have found useful: * XML Cooktop * XML Mind Standard Edition * Pete's XML Editor Free XML Viewer

7 E0262 – MIS – Multimedia Storage Techniques XML Syntax: XML Code: Robert A+ Lenard A-

8 E0262 – MIS – Multimedia Storage Techniques XML -Structure XML code has five components of document: 1.Prolog 2.Elements 3.Attributes 4.Entity reference 5.Comments. ---------------------------------------------------------------- Prolog-first structural elements. It has XML declaration and Data Type Declaration (DTD) First structural element. Data type 1.0 & encoding rules some special character is encoded special sequences after processing we can know what kind of special character you encounter in program.

9 E0262 – MIS – Multimedia Storage Techniques XML Elements Elements are common form of Markup. They contain the opening and closing tags, child elements, and data. Robert ----->element A+ ----> empty element XML is case sensitive. is not correct Elements naming convention: Must begin with an underscore or letter Can contain letters, digits, underscore, hyphen etc

10 E0262 – MIS – Multimedia Storage Techniques XML Attribute An attribute appears within the opening tag of an element. Must not contain any white spaces. Must begin with a letter or an underscore. Robert A+

11 E0262 – MIS – Multimedia Storage Techniques XML Entity references They are used to reference data that is not directly in the structure It can be internal or external Built in entity like &,, “,' The string Tin&Tin(“Don't read x<y”) Tin&Tin("Don&apos;t read x<y") ampersand escape sequence here

12 E0262 – MIS – Multimedia Storage Techniques XML Comment Syntax Robert A+ Lenard A-

13 E0262 – MIS – Multimedia Storage Techniques XML Commenting out XML To temporarily remove some XML code from your XML document. Robert A+ <!-- Lenard A- -->

14 E0262 – MIS – Multimedia Storage Techniques Processing Instructions Used to provide information to the application Name is special command, pi names beginning with xml are reserved Eg. In case of image file, application will be informed to open image With bmp or jpeg opener. Or will be informed that image type is jpeg. etc

15 E0262 – MIS – Multimedia Storage Techniques CDATA sections CDATA section instructs the XML parser to ignore most Markup characters <![CDATA[ temp=*p; --->asterisk *p=q; *q=temp; If(temp<0) temp=-temp; ]]> All characters data in between is passed to the application without interpretation.

16 E0262 – MIS – Multimedia Storage Techniques When an element appears within another element, it is said that the inner element is "nested". The term nested can be related directly to the word "nest". If an element is nested within another element, then it is surrounded, protected, or encapsulated by the outer element Example A XML Nesting

17 E0262 – MIS – Multimedia Storage Techniques Example B All elements are closed in the order that they were opened. Those elements which were opened first are closed last. Example B is what example A must look like to be a well-formed XML document.

18 E0262 – MIS – Multimedia Storage Techniques Broken XML Code: Mr. Garcia Hello there! How are we today? Well-Formed XML Code: Mr. Garcia Hello there! How are we today? The error in the first example was : The document suffers from improper nesting. The body element was opened inside the to element, yet body was not closed before the to element was closed!

19 E0262 – MIS – Multimedia Storage Techniques Entity References If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element. if salary if salary < 1000 then There are 5 predefined entity references in XML: < < less than > > greater than & & ampersand &apos; ' apostrophe " " quotation mark

20 E0262 – MIS – Multimedia Storage Techniques DTD (Document type declaration) Important for displaying in a browser XML allows us to create own tag names Four kinds of declarations: Element type Attribute type Entity type Notation type Element type: helps to identify the name of the elements and nature of the content. Example: <xsd:element name=”Name” type=”xsd:string” maxOccurs=”unbounded/> They can be defined with reference to cardinality. (How many times they appear in document.) Xsd-keyword used to define element Name is element, unbounded-number of times element is occur.

21 E0262 – MIS – Multimedia Storage Techniques Attribute list declaration Attributes should have name and type. They can have Restriction with reference to cardinality. <xsd:attribute name=”city” type=”xsd:string” fixed=”bangalore”/> Fixed is default cannot be changed.

22 E0262 – MIS – Multimedia Storage Techniques Entity declaration Allows us to associate a name with some other fragment or content.. 2 types are there: Internal entity External entity Internal entity: &lt, &gt,&amp, &apos, &quot. External entity: associated a name with the contents of another file <!entity IISclogo SYSTM “/institute/logo.gif> IISc logo will be replace by image.

23 E0262 – MIS – Multimedia Storage Techniques XML(Table) A table is divided into rows (with the tag), and each row is divided into data cells (with the tag). td stands for "table data," and holds the content of a data cell. A tag can contain text, links, images, lists, forms, other tables, etc

24 E0262 – MIS – Multimedia Storage Techniques XPath - Finding Information XPath is the solution to finding information in an XML document. XPath uses expressions to find elements, attributes, and other information in your XML. If you have an XML document that contained a bunch of your favorite books, each with author children elements, you can use a one line XPath expression to find all the authors of your favorite books! The most common place people might see XPath expressions are in XSLT (Extensible Stylesheet Language Transformation).

25 E0262 – MIS – Multimedia Storage Techniques Simple Links Resembles HTML <link xml:link=”simple” href=”http//www.iisc.ernet.in> Home page

26 E0262 – MIS – Multimedia Storage Techniques Extended Links (relation between 2 or more resources) <elink xml:link=”extended” Home page Home page ---

27 E0262 – MIS – Multimedia Storage Techniques Structure of an XML Document

28 E0262 – MIS – Multimedia Storage Techniques Structure of an XML Document

29 E0262 – MIS – Multimedia Storage Techniques Structure of an XML Document

30 E0262 – MIS – Multimedia Storage Techniques Structure of an XML Document

31 E0262 – MIS – Multimedia Storage Techniques Structure of an XML Document

32 E0262 – MIS – Multimedia Storage Techniques Structure of an XML Document


Download ppt "E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language)  XML is a markup language for creating documents containing structured information."

Similar presentations


Ads by Google