XML. What is XML? XML stands for EXtensible Markup Language.XML is a markup language much like HTML. XML was designed to describe data. XML was created.

Slides:



Advertisements
Similar presentations
XML Document Type Definitions ( DTD ). 1.Introduction to DTD An XML document may have an optional DTD, which defines the document’s grammar. Since the.
Advertisements

31 Signs That Technology Has Taken Over Your Life: #6. When you go into a computer store, you eavesdrop on a salesperson talking with customers -- and.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Tutorial 11 Creating XML Document
Introduction to XML: Yong Choi CSU Bakersfield.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introduce of XML Xiaoling Song CS157A. What is XML? XML stands for EXtensible Markup Language XML stands for EXtensible Markup Language XML is a markup.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
 Introduction to XML Introduction to XML  Features of XML Features of XML  Syntax of XML Syntax of XML  Syntax rules of XML document Syntax rules.
Validating DOCUMENTS with DTDs
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
What is XML? XML stands for EXtensible Markup Language
XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
1 XML at a neighborhood university near you Innovation 2005 September 16, 2005 Kwok-Bun Yue University of Houston-Clear Lake.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Pemrograman Berbasis WEB XML -Aurelio Rahmadian- Sumber: w3cschools.com.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
XML Syntax - Writing XML and Designing DTD's
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.
Advanced Java Session 9 New York University School of Continuing and Professional Studies.
 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,
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
Electronic Commerce COMP3210 Session 4: Designing, Building and Evaluating e-Commerce Initiatives – Part II Dr. Paul Walcott Department of Computer Science,
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Lecture 6 XML DTD Content of.xml fileContent of.dtd file.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
XML eXtensible Markup Language. Topics  What is XML  An XML example  Why is XML important  XML introduction  XML applications  XML support CSEB.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
XML Validation I DTDs Robin Burke ECT 360 Winter 2004.
WEB APPLICATION DEVELOPMENT For More visit:
Consuming eXtensible Markup Language (XML) feeds.
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.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
Web Technologies COMP6115 Session 4: Adding a Database to a Web Site Dr. Paul Walcott Department of Computer Science, Mathematics and Physics University.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
An Introduction to XML Sandeep Bhattaram
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Understanding How XML Works Ellen Pearlman Eileen Mullin Programming the.
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
What it is and how it works
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
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.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
ASHIMA KALRA  INTRODUCTION OF XML INTRODUCTION OF XML  XML FEATURES XML FEATURES  XML SYNTAX XML SYNTAX  XML ELEMENTS XML ELEMENTS  XML ATTRIBUTES.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Introduction to XML Extensible Markup Language.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML intro. 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.
XML BASICS and more…. What is XML? In common:  XML is a standard, simple, self-describing way of encoding both text and data so that content can be processed.
Unit 4 Representing Web Data: XML
Java XML IS
Chapter 7 Representing Web Data: XML
What is XML?.
Allyson Falkner Spokane County ISD
Presentation transcript:

XML

What is XML? XML stands for EXtensible Markup Language.XML is a markup language much like HTML. XML was designed to describe data. XML was created to structure, store and to send information. It is just pure information wrapped in XML tags. Someone must write a piece of software to send, receive or display it. ( APIs have been developed in C, C++, java and other languages that help in creating, reading and manipulating XML documents. Therefore it becomes easy to write such software ). XML is a cross-platform, software and hardware independent tool for transmitting information. XML tags are not predefined. You must define your own tags.

Example 1 : Mocha Java Espresso 12.50

ABC ffs Example 2

Uses XML is used to Exchange Data: In the real world, computer systems and databases contain data in incompatible formats. One of the most time-consuming challenges for developers has been to exchange data between such systems over the Internet. Converting the data to XML can greatly reduce this complexity and create data that can be read by many different types of applications. XML can be used to Share Data: With XML, plain text files can be used to share data. Since XML data is stored in plain text format, XML provides a software- and hardware-independent way of sharing data.This makes it much easier to create data that different applications can work with. It also makes it easier to expand or upgrade a system to new operating systems, servers, applications, and new browsers.

XML can be used to Store Data: XML can also be used to store data. XML provides many of the things found in databases: storage (XML documents), schemas (DTDs, XML Schemas, RELAX NG, and so on), query languages (XQuery, XPath, XQL, XML-QL, QUILT, etc.), programming interfaces (SAX, DOM, JDOM), and so on. On the minus side, it lacks many of the things found in real databases: efficient storage, indexes, security, transactions and data integrity, multi-user access, triggers, queries across multiple documents, and so on. XML can be used to Create new Languages: XML is the mother of WAP and WML.

Origin XML and its related technologies are developed and approved by W3C. Released in December SGML (Standard Generalized Markup Language by IBM) was the first language that was used to describe data. XML is successor to SGML, simplified and adapted to internet. XML is a subset of SGML.(HTML also was successor of SGML.) XML as been used to define successor of HTML called XHTML. SGML and XML are meta-languages.

XML applications a)WML(Wireless markup language), MathML(Mathematical Markup Language) b)All deployment descriptors in J2EE specification uses XML c) JSP (yes, JSPs can be coded as XML)

Harry Potter Ron Reminder Please, get your magic wand. " Root element Empty Elements Attributes XML structure Elements Comment Processing instructions Entity References

There are 5 pre-declared entities: &lt ( ), &quot (“), &apos(‘), &amp (&)

Redefining XML An XML document is an information unit that can be viewed in two ways: as a linear sequence of characters that contain character data or markup or entity references, or as an abstract data structure that is a tree of nodes. (Entity references are replaced by with what ever they refer to (their referents). (Element names should not begin with a number and cannot contain spaces.

Well-formed Constraints All XML elements must nest correctly. XML tags are case sensitive. The case of the start tag and and its corresponding end tag must match. All XML elements must be properly nested All XML documents must have one and only one Root element All the elements (other than the root)must have one and one parent Attribute values must always be quoted Empty tags must end with a ‘/’. An XML document that confirms to the above rules is called a “Well formed” XML document.

DTD Document Type Definition The DTD defines the structure of the xml document and how content is nested. An XML document is valid only when it is well- formed and confirms to the DTD (or XML schema) defined for it. DTD defines the grammar rules for forming an XML document.

Two ways to link a dtd with xml XML document itself contains an Internal DTD. Create a separate file with any name and with extension.dtd and link it to xml file like this: or Root element

DTD components Declarations: DOCTYPE: Click to view xml Root element

ELEMENT Declaration Text Only: Element Only: Mixed: Anything: Empty:

Cardinality none: the absence of cardinality indicates one and only one *: 0 or more + 1 or more ? 0 or 1 Sequence list: comma separated list Choice list: |

Example:Click to view xmlClick to view xml <!DOCTYPE priceList [ ]> Mocha Java Embedding dtd in xml

Attribute Declarations Possible examples to declare ATTLIST tag <!ATTLIST review titleCDATA#REQUIRED ISBNID#REQUIRED Similar IDREF#IMPLIED libnoNMTOKEN#IMPLIED authorsNMTOKENS #REQUIRED hardbound(YES|NO)“NO” sourceCDATA#FIXED “BOOK” > types defaults

CDATA : text in quotes ID: text, but its value must be unique in the document. IDREF : text that is equal to the value of an ID attribute of some element in the document. NMTOKEN : text that cannot contain white space NMTOKENS : a comma-separated list of NMTOKEN items #REQUIRED: the attribute is required. #IMPLIED: the attribute is optional. #FIXED with default value: the attribute must always have the default value Names that begin with ‘xml’ is reserved.

Example1 ?xml version="1.0" ?> <!DOCTYPE bookreview [ <!ATTLISTreview titleCDATA#REQUIRED ISBNID #REQUIRED Similar IDREF#IMPLIED libnoNMTOKEN#IMPLIED authorsNMTOKENS #REQUIRED hardbound(YES|NO) "NO" source CDATA#FIXED "BOOK" > ]>

Powerful lessons in personal change Turning mistakes into stepping stones for success

Entity declaration All the entities except predefined entities need to be declared. Two types of Entities: a)Parameter Entity: Entity reference within used within the DTD. b)General Entity: Entity reference used within the XML document. DTD: %ParEntity; IN XML: &GenEntity; Gets replaced by its value

It is an error to put a parameter reference in the xml document. But it is not an error to put an entity reference in DTD in defining the value of another entity. But the reference will not be ‘resolved’ until it is used in the document. Example: In DTD In XML: &book; Designed by WW. All rights reserved

Drawback of DTD 1.Their syntax is not XML and so XML parsers cannot parse them into component parts very easily. 2.They have a very primitive system of data types. 3.They are not modular. It is not very easy to reuse a DTD. 4.They are not easily extensible. (No inheritance in DTD) DTDs are written in EBNF (Extended Backus- Naur Form) notation. XML Schema are replacement for DTD. XML schemas are intended to give XML all these features.

XML Parser XML parsers/processors are the processors which check if the XML document is well-formed (non- validating parser) or valid (validating parser). XML parsing is required so that our application can inspect, retrieve and modify the document contents. XML parser program this sits between XML document and our application.

Example of validating XML parser freely available: Xerces-C(C++), Xerces-J(Java) from Apache IBM4C(C++), IBM4J (Java) Oracle XML Parser that comes with 8i. Sun has included JAXP and JAXB API which provides support other parser. Sun also has a validating parser called The Java Project X TR2 which requires JDK1.1.6 ! XML Support

xml doc xml parser xml application xml doc return valid/invalid document

Harry Potter Ron Please, get your magic wand. <![CDATA[ if(a>b && a Character data that you don’t want to be parsed CDATA section

DOM and SAX Parsers

Parsing In an attempt to standardize the way parser should work, two specification has come out, that spells out the interfaces that an application can expect from a parser: SAX: the Simple API for XML: SAX processes the XML document a tag at a time and generates events. DOM: the Document Object Model: describes the document as a data-structure in the form of tree. It first loads the entire xml in the form of tree. Then application can edit any traverse and edit any node.

SAX Programming model in java XML source DTD (optional) SAXParser calls handler methods startDocument startElement characters endElement endDocument etc output Your Class implementing ContentHandler interface SAXParserFactory 2.input 1. creates 2. input eventsevents

DOM Programming model in java XML source DocumentBuilder Node DTD (optional) 3.Parse and build the tree Document (DOM) 2.input DocumentBuilderFactory 1.creates Your Class

SAX DOM 1.Fast, efficient for reading of XML data 2. Less memory 3.Cannot go back to the earlier visited node or leap ahead to different position. 4.Cannot be used to modify, add or delete nodes. 5.Not W3C standard 1.Slow reading of XML data 2. More memory 3. Can go to any position from anywhere. 4. Can be used to modify, add or delete nodes. 5. W3C standard