15 - XML(Extended Markup Language(Lecture Session-16...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
XML (Extended Markup Language) (Lecture Session-16) Chapters 27 Fri, Feb 26, 2010 1 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Fri, Feb 26, 2010 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS 2 Introduction to XML sample XML doc XML features DTD XML schema XML querying XML application Contents
Background image of page 2
XML What is XML: W3C standard for data exchange on the web. SGML(metalanguage) Definition of data and doc exchange languages. We can define new markup languages. Why it is different from HTML: XML differs from HTML in following: New tags can be defined at will. Structure can be nested to any arbitrary depths. It may contain an optional grammar in the form of DTD (Document Type Definition). DTD is the mechanism to define the structure of the XML. Fri, Feb 26, 2010 3 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
XML data model: Sample XML data instance: <Person> <Name> Alan </Name> <age>42</age> </Person> Graph Model for the above XML data instance is: Person Name age Alan 42 Fri, Feb 26, 2010 4 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS
Background image of page 4
XML Document properties: An XML document is of nested element structure. Each element contains a start tag and an end tag. Each element in a document can be either complex or atomic. Each element may optionally be associated with a set of attributes. A document is said to be well-formed if the names of starting and end- tag matched, tags are nested properly, and attributes are unique. Fri, Feb 26, 2010 5 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sample XML Document: <? xml version”1.0” ?> <!DOCTYPE publications SYSTEM “pub.dtd”> <publications> <book> <title> FCDS </title> <author> <name>Ullman</name> <address>Stanford </address> </author> <author> <name> Widom</name> <address>Stanford </address> </author> <price>50</price> </book> </publications> Fri, Feb 26, 2010 6 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS
Background image of page 6
Comments: Start with <!- and end with -> Location of DTD: May be in same file. <!DOCTYPE publications SYSTEM “pub.dtd”> <!DOCTYPE publications SYSTEM “http://www.xyz.com/pub.dtd”> Attributes : <book id=“CSE123” > // Element structure </book> Fri, Feb 26, 2010 7 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Document Type Definition (DTD): DTD serves as grammar (can be recursive) for the underlying XML document. To some extent it can also serve as a schema for the data represented by the XML document. It describes what elements, attributes etc. are permitted in the document. It is an option for an XML document to have a DTD. DTDs are recommended to ensure document conformity, especially in
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 28

15 - XML(Extended Markup Language(Lecture Session-16...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online