XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.

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

XML I.
Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
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.
XML 6.3 DTD 6. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:  Elements.
History Leading to XHTML
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
Tutorial 9 Working with XHTML
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
Document Type Definitions
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 5 – XML Basic School of Architecture, Design Science and Planning Faculty of.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Introduction to XML This material is based heavily on the tutorial by the same name at
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.
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
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 by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
XML: Overview MIS 181.9: Service Oriented Architecture 2 nd Semester,
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.
Introduction to XML. What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.
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
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
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,
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 6 – Document Type Definition (DTD) Outline 6.1Introduction 6.2Parsers, Well-formed and Valid XML.
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.
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 2nd EDITION Tutorial 1 Creating An Xml Document.
CIS 275—Web App Dev I XML. 2 Introduction to XMLXML XML stands for ________________________. HTML was designed to display data. XML was designed to _________.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
IS432 Semi-Structured Data Lecture 2: DTD Dr. Gamal Al-Shorbagy.
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.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
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.
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
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XML DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
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.
Unit 4 Representing Web Data: XML
Chapter 7 Representing Web Data: XML
Allyson Falkner Spokane County ISD
Presentation transcript:

XML 1 Enterprise Applications CE00465-M XML

2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that describes the content of the document (self-describing data) Java = Portable Programs XML = Portable Data XML does not specify the tag set or grammar of the language –Tag Set: mark-up tags that have meaning to a language processor –Grammar: defines correct usage of a language’s tags

XML 3 Enterprise Applications CE00465-M Applications of XML Configuration files –Used extensively in J2EE architectures Media for data interchange –A better alternative to proprietary data formats Business-to-business (B2B) transactions on the Web –Electronic business orders (ebXML) –Financial Exchange (IFX) –Messaging exchange (SOAP)

XML 4 Enterprise Applications CE00465-M XML versus HTML XML fundamentally separates content (data and language) from presentation; HTML allows a mix of content and presentation HTML explicitly defines a set of legal tags as well as the grammar (intended meaning) – … XML allows any tags or grammar to be used hence eXtensible – … Note: Both are based on Standard Generalized Markup Language (SGML)

XML 5 Enterprise Applications CE00465-M Simple XML Example Student.xml 2 Harry Nelson Computer Science VP

XML 6 Enterprise Applications CE00465-M Parsers & well-formed XML Documents A software program called an XML parser (or an XML processor) is required to process an XML document –Parser reads the documents, checks its syntax and reports any errors –XML documents are well formed if they are syntactically correct –XML documents requires a single root element, start and end tag for each element, properly nested tags and attribute values in quotes –Parsers can support either the Document Object Model (DOM) and/or Simple API for XML (SAX)

XML 7 Enterprise Applications CE00465-M XML Components Prolog –Defines the xml version, entity definitions and DOCTYPE Components of the document –Tags and attributes –CDATA (character data) –Entities –Processing instructions –Comments

XML 8 Enterprise Applications CE00465-M XML prolog XML Files always start with a prolog –The version of XML is required –The encoding identifies the character set –The prolog can contain entities and DTD definitions

XML 9 Enterprise Applications CE00465-M Document Type Definitions (DTDs) Introduced into an XML document by !DOCTYPE statement –DTDs define an XML document’s structure (i.e. what elements are allowed in the document) –An XML document doesn’t have to have a DTD –But are often recommended to ensure document conformity especially in B2B transactions Parsers are classified as validating or non-validating. Validating parsers check the XML document against the DTD –If the XML document conforms to the DTD it is said to be valid –If it fails to conform to the DTD but is syntactically correct it is said to be well formed –A valid document must also be well formed

XML 10 Enterprise Applications CE00465-M Example of a DTD Student.dtd

XML 11 Enterprise Applications CE00465-M Defining Elements <!ELEMENT XmlStudent (img,StdNo,FirstName,LastName,Phone,StartDate, Award,Faculty)> Types –EMPTY Element cannot contain any text or child elements –#PCDATA Only character data permitted –ANY Any well-formed XML data – List of legal child elements (no character data) – May contain character data and/or child elements (cannot define order and number of child elements)

XML 12 Enterprise Applications CE00465-M Defining Elements Cardinality –[none]Default (one and only one instance) –?0,1 –*0,1,…..,N –+1,2,…..,N List Operators –,Sequence (in order) –|Choice (one of several)

XML 13 Enterprise Applications CE00465-M Grouping Elements Set of elements can be grouped within parentheses –(Elem1?, Elem2?)+ Elem1 can occur 0 or 1 times followed by 0 or 1 occurrences of Elem2 The group (sequence) must occur 1 or more times OR –((Elem1, Elem2) | Elem3)* Either the group of Elem1, Elem2 is present (in order) or Elem3 is present, 0 or more times

XML 14 Enterprise Applications CE00465-M <!DOCTYPE Person[ <!ELEMENT Person ( (Mr|Ms|Miss)?, FirstName, MiddleName*, LastName,(Jr|Sr)? )> ]> Harry Nelson Element Example Note: The DTD has been embedded in the DOCTYPE, rather than being in a separate file

XML 15 Enterprise Applications CE00465-M Defining Attributes Example <!ATTLIST Product cost CDATA #FIXED “200” id CDATA #REQUIRED>

XML 16 Enterprise Applications CE00465-M Attribute Types CDATA –Essentially anything; simply unparsed data Enumeration –Attribute(value1|value2|value3)[Modifier] Eight other attribute types –ID,IDREF,NMTOKEN,NMTOKENS,ENTITY,ENTITIES,NOTATION

XML 17 Enterprise Applications CE00465-M Attribute Modifiers #IMPLIED –Attribute is not required #REQUIRED –Attribute must be present #FIXED “value” –Attribute is present and always has this value Default value (applies to enumeration)

XML 18 Enterprise Applications CE00465-M XML DOCTYPE Document Type Declarations –Specifies the location of the DTD defining the syntax and structure of elements in the document –Common forms –The root identifies the starting element (root element) of the document –The DTD can be external to the XML document, referenced by a SYSTEM or PUBLIC URL SYSTEM URL refers to a private DTD –Located on the local file system or HTTP server PUBLIC URL refers to a DTD intended for public use

XML 19 Enterprise Applications CE00465-M XML DOCTYPE Specifying a PUBLIC DTD –The Formal Public identifier (FPI) has four parts: 1.Connection of DTD to a formal standard 2.Group responsible for the DTD 3.Description and type of document 4.Language used in the DTD –Examples: <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”

XML 20 Enterprise Applications CE00465-M XML Comments The same as HTML comments

XML 21 Enterprise Applications CE00465-M Processing Instructions Application-specific instruction to the XML processor – Example 2 Harry Nelson Computer Science VP

XML 22 Enterprise Applications CE00465-M XML Root Element Required for XML-aware applications to recognise beginning and end of document Example 2 Harry Nelson Computer Science VP

XML 23 Enterprise Applications CE00465-M XML Tags Tag names; –Case sensitive –Start with a letter or underscore –After first character, numbers, ‘-’ and ‘.’ are allowed –Cannot contain whitespaces –Avoid use of colon except for indicating namespaces For a well-formed XML document –Every tag must have an end tag ….. –All tags must be nested (tag order can’t be mixed) Tags can also have attributes –Attributes provide metadata for the element –Every attribute value must be enclosed in ”” with no commas between attributes –Same naming convention as elements

XML 24 Enterprise Applications CE00465-M Document Entities Entities refer to data item, typically text –General entity references start with & and end with ; –The entity reference is replaced by its true value when parsed –The characters & ’ “ require entity references to avoid conflicts with the XML application (parser) <>& &apos;" Entities are user definable <!DOCTYPE university[ ]> My Faculty is,&myfaculty; Note we’ve included the DTD in the prolog of the above code

XML 25 Enterprise Applications CE00465-M Document Entities Internet Explorer displays:

XML 26 Enterprise Applications CE00465-M CDATA Sections CDATA (character data) is not parsed Example // C++ comment if ( this->getX() < 5 && value[ 0 ] != 3 ) cerr << this->displayError(); <![CDATA[ // C++ comment if ( this->getX() < 5 && value[ 0 ] != 3 ) cerr displayError(); ]]> C++ How to Program by Deitel & Deitel

XML 27 Enterprise Applications CE00465-M CDATA Sections Internet Explorer displays

XML 28 Enterprise Applications CE00465-M Extensible Stylesheet Language (XSL) Consists of two parts –XSL Transformation language (XLST) Used to transform an XML document from one form to another –XSL formatting objects Provides an alternative to CSS for formatting and styling an XML document More information –XML: –DTD: –XSLT: