C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
An Introduction to XML Based on the W3C XML Recommendations.
Extensible Markup Language Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Tutorial 11 Creating XML Document
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
Copyright © 2002 ProsoftTraining. All rights reserved. XML Document Design.
Copyright © 2003 Pearson Education, Inc. Slide 2-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
E X TENSIBLE M ARKUP L ANGUAGE (XML). What is XML?  XML stands for EXtensible Markup Language  XML is mainly designed to carry (or transmit) data, not.
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.
Introduction to XML Eugenia Fernandez IUPUI. What is XML? From the World Wide Web Consortium (W3C) The Extensible Markup Language (XML) is the universal.
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.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training 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.
August Chapter 2 - Markup and Core Concepts Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
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.
 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,
Session IV Chapter 9 – XML Schemas
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter X IXXXXXXXXXX XXXXXX.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language  XML is a markup language for creating documents containing structured information.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation An Introduction to XML.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
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
1 Introduction to XML XML stands for Extensible Markup Language. Because it is extensible, XML has been used to create a wide variety of different markup.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
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.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
Well Formed XML The basics. A Simple XML Document Smith Alice.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
PART 1 XML Basics. Slide 2 Why XML Here? You need to understand the basics of XML to do much with Android All of they layout and configuration files are.
5 Copyright © 2004, Oracle. All rights reserved. Navigating XML Documents by Using XPath.
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.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
4 Copyright © 2004, Oracle. All rights reserved. Validating XML by Using XML Schema.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
Extensible Markup Language (XML) Pat Morin COMP 2405.
Unit 4 Representing Web Data: XML
XML in Web Technologies
Extensible Markup Language XML
Chapter 7 Representing Web Data: XML
Allyson Falkner Spokane County ISD
Extensible Markup Language (XML)
Presentation transcript:

C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 2 XML Standards Document Type Definition XML Language Defines and validates XML Namespace Uniquely identifies elements XML Schema Defines and validates XPath Locates nodes XSL/XSLT Stylesheet AppliesTransformed to Output Document Processed by XML Processor (DOM and SAX API) Used by /Catalog/Item

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 3 Extensible Markup Language Extensible Markup Language (XML) describes data objects called XML documents that are composed of markup and data. Markup and Data Custom Tags XML Document Web Data XML Processors

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 4 Advantages of Using XML XML enables: A simple and extensible way to describe data The ability to interchange data Simplified business-to-business communication Writing of smart agents The ability to perform smart searches A sample XML document: Building Oracle XML Applications Oracle XML Handbook Beginning XML Second Edition

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 5 Oracle XML Support Oracle products provide support for XML in: Development tools Middle-tier frameworks Database storage Oracle XDK 10g Oracle BI Publisher

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C Weiss Fripp 8200 Example: A Simple XML Page

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 7 XML Document Structure An XML document contains the following parts: Prologue Root element Epilogue

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 8 XML Declaration XML documents must start with an XML declaration. The XML declaration: Looks like a processing instruction with the xml name, as in the following example: Must contain the version attribute May include the following elements: – encoding attribute – standalone attribute Is optional in XML 1.0 but mandatory in XML

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 9 Components of an XML Document XML documents comprise storage units containing: Parsed data, including the: –Markup (elements, attributes, entities) used to describe the data that they contain –Character data described by markup Unparsed data, textual or binary information (graphic and sound data), which is taken as entered Rachael O'Leary

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 10 XML Elements An XML element: –Has a start tag, end tag, and optional data content –Has tag names that are case-sensitive Empty elements: –Do not contain any data –May appear as a single tag Steven King Start Tag End Tag Data Content Element Tag Name

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 11 Markup Rules for Elements There is one root element, sometimes called the top-level or document element. All elements: –Must have matching start and end tags, or be a self-closing tag (an empty element) –Can contain nested elements, so that their tags do not overlap –Have case-sensitive tag names subject to naming conventions. — Element names start with a letter, contain no spaces, and do not start with the letters xml. The element data content may contain a white space, such as spaces, tabs, new lines, and combinations of these.

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 12 XML Attributes An XML attribute is a name-value pair that: Is specified in the start tag, after the tag name Has a case-sensitive name Has a case-sensitive value that must be enclosed in matching single or double quotation marks Provides additional information about the XML document or XML elements 1000

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 13 Using Elements Versus Attributes President King Elements Attributes

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 14 XML Entities An XML entity: Is a unit of data storage Is identified by a case-sensitive name Is used as replacement text (substituted) when referencing its name between an ampersand ( & ) and a semicolon ( ; ) Has predefined names for special XML characters: – < for less-than ( ) – & for ampersand ( & ) – " for double quotation mark ( " ) – &apos; for single quotation mark ( ' ) Salaries must not be < 1000

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 15 XML Comments XML comments: Start with <!-- End with --> May appear anywhere in the character data of a document, and before the root element Are not elements, and can occupy multiple lines May not appear inside a tag or another comment <!–- Comment: This document has information about employees in the company --> Steven King

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 16 A Well-Formed XML Document Every XML document must be well formed. An XML document must have one root element. An element must have matching start and end tag names, unless they are empty elements. Elements can be nested but cannot overlap. All attribute values must be quoted. Attribute names must be unique in the start tag of an element. Comments and processing instructions do not appear inside tags. The special characters < and & cannot appear in the character data of an element or attribute value.

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 17 Class Activity Identify errors in the following examples: Is this legal? No Is this legal

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 18 Comparing XML and HTML XML: –Is a markup language for describing data –Contains user-defined markup elements –Is extensible –Is displayed as a document tree in a web browser –Conforms to rules for a well-formed document HTML: –Is a markup language for formatting data in a web browser –Contains predefined markup tags –Is not extensible –Does not conform to well-formed document rules

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 19 XML Development Developing XML documents can be done using: A simple text editor, such as Notepad A specialized XML editor, such as XMLSpy Oracle JDeveloper 10g XML-related features that include: –Syntax checking for XML documents –XML Editor with code insight for XML schema-driven editing –Registering of external XML schemas –Validation of XML documents against registered XML schemas

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 20 XML Namespaces An XML namespace: Is identified by a case-sensitive Internationalized Resource Identifier (IRI) reference (URL or URN) Provides universally unique names for a collection of names (elements and attributes) department_id employee_id urn:hr:departments

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 21

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 22 XML Namespace Declarations: Example <department xmlns="urn:hr:department-ns" xmlns:emp="urn:hr:employee-ns"> Executive Steven King Neena Kochhar

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 23 Why Validate an XML Document? Well-formed documents satisfy XML syntax rules, and not the business requirements about the content and structure. Business rules often require validation of the content and structure of a document. XML documents must satisfy structural requirements imposed by the business model. A valid XML document can be reliably processed by XML applications. Validations can be done by using a DTD or an XML schema.

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 24 Document Type Definition A document type definition (DTD): Is the grammar for an XML document Contains the definitions of: –Elements –Attributes –Entities –Notations Contains specific instructions that the XML parser interprets to check document validity May be stored in a separate file (external) May be included in the document (internal)

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 25 Simple DTD Declaration: Example Example of a simple DTD with element declarations: A valid XML document based on the DTD is: Note: All child elements must be defined. Steven King

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 26 XML Schema An XML schema: Uses an XML language that defines and validates the structure of XML documents Is stored in an XML Schema Definition (XSD) document Defines components, such as: –Simple types definitions –Complex type definitions –Element declarations –Attribute declarations Supports XML namespaces and built-in, simple, and complex data types XSD Validates References Instance

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 27

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 28 XML Schema Document: Example A simple XML schema uses: –A required XML namespace string, with an xs prefix, –The element as its document root –The element to declare an element A valid XML instance document: Finance

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 29 XML Schema Versus DTD XML schema: –Is more powerful and flexible than a DTD –Provides better namespace support than a DTD –Is written in XML syntax –Is extensible –Provides data-type support DTD: –Provides the ENTITY functionality that is not supported by XML schemas –Can be embedded in an XML document –Is written in Standard Generalized Markup Language (SGML)

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 30 XML Path Language XML Path Language (XPath): Is primarily used to address the nodes of an XML document modeled as a tree of nodes Is named after its use of a path notation for navigating through the hierarchical structure of an XML document Uses a compact, non-XML syntax to form expressions for use in Uniform Resource Identifier (URI) and XML attribute values Fully supports XML namespaces Is designed to be used by XML applications, such as XSLT and XPointer

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 31 XPath Model Document root num="1" 10 Administration num="2"

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 32 XSLT and XPath XSLT: Transforms XML into plain text, HTML, or XML Specifies transformation rules in elements with attributes that use XPath expressions <xsl:stylesheet version="1.0" xmlns:xsl="

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 33 XSL Extensible Stylesheet Language (XSL) has two parts: XSL Transformations (XSLT) XSL Formatting Objects (XSL-FO) XSL

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 34 XSLT XSL Stylesheet Input XML Document Output XML Document XSL Processor Matching Rule Output Data

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 35 XSLT Stylesheet An XSLT stylesheet is an XML document containing: A root element declaring: –The xsl namespace prefix –The mandatory namespace URI One or more elements and other XSL elements defining transformation rules <xsl:stylesheet version="1.0" xmlns:xsl="

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 36 XSLT Stylesheet: Example <xsl:stylesheet version ="1.0" xmlns:xsl=" Id Name Salary

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 37 Viewing the Transformed Document Perform one of the following actions: Open the XML document in a web browser. View the oraxsl command-line processor output. 100 King Kochhar 18000

Copyright © 2011, Oracle and/or its affiliates. All rights reserved. C - 38