1 eXtensible Markup Language. XML is based on SGML: Standard Generalized Markup Language HTML and XML are both based on SGML 2 SGML HTMLXML.

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
David Burdett May 11, 2004 Package Binding for WS CDL.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
Programming Language Concepts
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
1.
Break Time Remaining 10:00.
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
PP Test Review Sections 6-1 to 6-6
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
XML and Databases Exercise Session 3 (courtesy of Ghislain Fourny/ETH)
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Sample Service Screenshots Enterprise Cloud Service 11.3.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1..
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
CIS 670 Fall 2001 (LN 5)1 XML 4 Introduction to XML –XML basics –DTDs –XML and semistructured data 4 Query languages for XML XML-QL, XQL, XSL 4 XML extensions.
Dr. Alexandra I. Cristea XHTML.
: 3 00.
5 minutes.
What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry data, not to display data XML.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Essential Cell Biology
Clock will move after 1 minute
PSSA Preparation.
Chapter 11 Creating Framed Layouts Principles of Web Design, 4 th Edition.
Immunobiology: The Immune System in Health & Disease Sixth Edition
Chapter 13 Web Page Design Studio
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Introduction Peter Dolog dolog [at] cs [dot] aau [dot] dk Intelligent Web and Information Systems September 9, 2010.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Introduction to XML This material is based heavily on the tutorial by the same name at
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
Electronic Commerce COMP3210 Session 4: Designing, Building and Evaluating e-Commerce Initiatives – Part II Dr. Paul Walcott Department of Computer Science,
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
Web Technologies COMP6115 Session 4: Adding a Database to a Web Site Dr. Paul Walcott Department of Computer Science, Mathematics and Physics University.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
An Introduction to XML Sandeep Bhattaram
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
What it is and how it works
When we create.rtf document apart from saving the actual info the tool saves additional info like start of a paragraph, bold, size of the font.. Etc. This.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XML Introduction to XML Extensible Markup Language.
What is XML?.
Presentation transcript:

1 eXtensible Markup Language

XML is based on SGML: Standard Generalized Markup Language HTML and XML are both based on SGML 2 SGML HTMLXML

HTML was designed to display data and to focus on how data looks. HTML is about displaying information, while XML is about describing information XML was designed to describe data and to focus on what data is. It is important to understand that XML was designed to store, carry, and exchange data. XML was not designed to display data. 3

XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to describe data XML tags are not predefined. You must define your own tags Extensible: can be extended to lots of different applications. Markup language: language used to mark up data. Meta Language: Language used to create other languages. XML uses a Document Type Definition (DTD) or an XML Schema to describe the data 4

Harry Potter J. K. Rowling 1999 Scholastic 5

Harry Potter J. K. Rowling 1999 Scholastic 6

7

1. XML is used to Exchange Data With XML, data can be exchanged between incompatible systems 2. XML and B2B With XML, financial information can be exchanged over the Internet. 3. XML can be used to Share Data With XML, plain text files can be used to share data. 8

4. XML is free and extensible XML tags are not predefined. we must "invent" your own tags. 5. XML can be used to Store Data With XML, plain text files can be used to store data. 6. XML can be used to Create new Languages XML is the mother of WAP and WML. 7. HTML focuses on "look and feel XML focuses on the structure of the data. 9

My First XML Introduction to XML What is HTML What is XML XML Syntax Elements must have a closing tag Elements must be properly nested 10

Element content book Mixed content Chapter Simple content para Empty content prod 11

Names can contain letters, numbers, and other characters Names must not start with a number or punctuation character Names must not start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces Avoid "-" and "." in names. For example, if you name something "first-name," it could be a mess if your software tries to subtract name from first. Or if you name something "first.name," your software may think that "name" is a property of the object "first." 12

Names should be short and simple XML documents often have a corresponding database, in which fields exist corresponding to elements in the XML document. Attribute values must always be enclosed in quotes, but either single or double quotes can be used. Ex: 13

XML elements can have attributes. Attributes are used to provide additional information about elements. In HTML. The SRC attribute provides additional information about the IMG element. In XML 14

Data can be stored in child elements or in attributes. Attributes : Anna Smith Elements: female Anna Smith 15

A well-formed XML document conforms to XML syntax rules and constraints, such as: The document must contain exactly one root element and all other elements are children of this root element. All markup tags must be balanced; that is, each element must have a start and an end tag. Elements may be nested but they must not overlap. All attribute values must be in quotes. 16

According to the XML specification, an XML document is considered valid if it has an associated DTD declaration and it complies with the constraints expressed in the DTD. To be valid, an XML document must meet the following criteria: Be well-formed Refer to an accessible DTD-based schema using a Document Type Declaration: 17

The Document Type Definition (DTD) forms the basis of valid documents because it establishes the grammar of an XML vocabulary, which in turn determines the structure of XML documents. A DTD is necessary for performing document validation, which is an important part of XML content development and deployment. 18

ELEMENT is used to declare element names Ex: ATTLIST To declare attributes 19

TypesDescription CDATAUnparsed character data Enumerateda series of string values IDA unique identifier IDREFA reference to an ID declared somewhere NMTOKEN A name consisting of XML token characters NMTOKENS Multiple names consisting of XML token characters. 20

<!DOCTYPE root_ele_name [ DTD code ]> 21

InternalDTDs Placing the DTD code in the DOCTYPE tag in this way products.xml <!DOCTYPE products [ ]> 1 XYZ XYZ descr

SYSTEM the definitions are developed and used by the same comp or PUBLIC if the definition can be used by public 23

products.dtd products.xml 24

25 Ex :

26

Xml Xsl Xsd 27

28 Apples Bananas African Coffee Table

XML Schema is an XML-based alternative to DTD. An XML schema describes the structure of an XML document. The XML Schema language is also referred to as XML Schema Definition (XSD). 29

An XML Schema: defines elements that can appear in a document defines attributes that can appear in a document defines which elements are child elements defines the order of child elements defines the number of child elements defines whether an element is empty or can include text defines data types for elements and attributes 30

1.Simple elements 2.Complex elements 31

A simple element is an XML element that can contain only text. It cannot contain any other elements or attributes. Xml: abc Xml schema: 32

33

34

35

36

A complex element is an XML element that contains other elements and/or attributes. 37

38

DTD supports types ID,IDREF,CDATA etc., Schema supports all primitive and user defined data types DTD supports No specifier, ?, *, + sign Schema hava minOccurs and maxOccurs attributes XML Schemas are extensible to future additions XML Schemas are richer and more powerful than DTDs XML Schemas are written in XML 40

An XML parser is a piece of code that reads a document and analyzes its structure. The parser is the engine for interpreting our XML documents The parser reads the XML and prepares the information for your application. How to use a parser 1. Create a parser object 2. Pass your XML document to the parser 3. Process the results 41

import com.ibm.xml.parser.*; import java.io.*; public class SimpleParser {public static void main (String a[]) throws Exception {Parser p=new Parser("err"); FileInputStream fis=new FileInputStream(a[0]); TXDocument doc=p.readStream(fis); doc.printWithFormat(new OutputStreamWriter(System.out)); } 42

There are two common APIs that parsers use. DOM is the Document Object Model API SAX is the Simple API for XML 43

DOM uses a tree based structure. DOM reads an entire XML document and builds a Document Object. The Document object contains the tree structure. The top of the tree is the root node. The tree grows down from this root, defining the child elements. DOM is a W3C standard. Using DOM, we can also perform insert nodes, update nodes, and deleting nodes. 44

Node: The base data type of the DOM. Methods: Element: Attr: Represents an attribute of an element. Text: The actual content of an Element or Attribute Document: Represents the entire XML document. A Document object is often referred to as a DOM tree. 45

46 Node getChildNodes(), getNodeName(), getNodeValue(), hasChildNodes(). Document createElement(), createAttribute(), createTextNode(), Element NodeList getLength() item()

SAX parsers are event-driven The parser fires an event as it parses each XML item. The developer writes a class that implements a handler interface for the events that the parser may fire. 47

DocumentHandler Functions in this interface startDocument() startElement() endElement() endDocument() void setDocumentLocator(Locator) void characters(char[ ],int start,int length) This event fires when text data is found in the XML Document 48 class HandlerBase is a sub class of DocumentHandler also called Adapter Class.

DOMSAX Uses more memory and has more functionality Uses less memory and provides less functionality The entire file is stored in an internal Document object. This may consume many resources The developer must handle each SAX event before the next event is fired. For manipulation of the document, DOM is best choice For simple parsing and display SAX will work great 49