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 HTML To create web pages. Is platform independent Edited using text editor or notepad Markup language – Contains Tags Angle brackets. eg. Good Morning In case end tag is not required. src=attribute followed by doll.jpg Tags are not case sensitive Hello It has head and body

3 E0262 – MIS – Multimedia Storage Techniques HTML format. Head has information about document And body the actual content. Web page ------

4 E0262 – MIS – Multimedia Storage Techniques XML & HTML In HTML tags are prefined, language is fixed. XML specifies neither the tag set or semantics. It is a open language, defines tag semantics. XML defines 3 specifications. 1. Basic XML specification(XML 1.0) 2. XML pointer language (Xpointer) XML linking language (Xlink) 3. XSL-Extensible style language

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 code. XML code has five components: 1.Prolog 2.Elements 3.Attributes 4.Entity reference 5.Comments. ---------------------------------------------------------------- Prolog-first structural elements. It has XML declaration and Data Type Declaration (DTD) Data type 1.0 & encoding rules.

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 A+ ----> empty XML is case sensitive. 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. Robert A+

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

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 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

16 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.

17 E0262 – MIS – Multimedia Storage Techniques CDATA section A CDATA section instructs the XML parser to ignore most Markup characters. Example: <![CDATA[ temp=*p; *p=*q; *q=temp; if(temp<0) temp=-temp; ]]> All character data in between is passed to the application Without interpretation.

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 content of the elements. 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)

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

33 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