XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.

Slides:



Advertisements
Similar presentations
Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
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.
XML: text format Dr Andy Evans. Text-based data formats As data space has become cheaper, people have moved away from binary data formats. Text easier.
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
An Introduction to XML Based on the W3C XML Recommendations.
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
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.
Extensible Markup Language Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
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
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.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
COS 381 Day 14. Agenda Questions?? Resources Source Code Available for examples in Text Book in Blackboard
XML: What, Why, When & How? Hope Greenberg Center for Teaching & Learning June 11 & 18.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
XML – Extensible Markup Language Sivakumar Kuttuva & Janusz Zalewski.
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.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
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.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
School of Computing and Management Sciences © Sheffield Hallam University To understand the Oracle XML notes you need to have an understanding of all these.
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.
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language)  XML is a markup language for creating documents containing structured information.
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.
XML - Why: The HTML-Dilemma HTML, SGML, XML - How: Syntax, Concept, Language Elements Basics Well-formed XML-Documents (without DTD) Valid XML-Documents.
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
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.
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.
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.
Windows Presentation Foundation (WPF) Chapter 16 Dr. Abraham.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
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
Web Technologies COMP6115 Session 4: Adding a Database to a Web Site Dr. Paul Walcott Department of Computer Science, Mathematics and Physics University.
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.
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.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
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.
Unit 8 XML Documents. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Characters and white.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
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:
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
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.
X M L Extensible Markup Language It is a cross platform tool or a language to achieve data transfer between the cross platform. Note  1.XML is not a replacement.
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 eXtensible Markup Language by Darrell Payne

Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML Training Course 2001 DevXCon Training Conference Currently developing XML course for Logicon

XML eXtensible Markup Language Standard General Markup Language(SGML) Meta-tag language Used for creating other markup languages Standard adopted for SGML in 1986 Hyper Text Markup Language(HTLM) Application of SGML Formatting Language eXtensible Markup Language(XML) Meta-tag language XML = DATA World Wide Web Consortium W 3 C ((!Standard) && (Specification)) // “c” code humor XML Version 1.0 February 1998 XML is not designed to replace HTML

SGML – HTML – XML diagram SGMLXML HTML application WML application

XML Family of Tools and Their Relationship Namespace SAX DOM XML Info set XML Schema XPath XSL XSLT XPointer XLink Style and Transformation Linking and Pointing Underlying And Object Model Programmatic Interface Complex Data Modeling XML Developer's Guide - McGraw Hill - Page 12

HTML vs. XML Html Predefined tags Syntax is loose File extensions usually “.html” of “.htm” Not required to be Well – Formed Some closing tags optional Attribute value quotes may be omitted XML User defined tags Syntax is exact File extensions usually “.xml” Closing tags mandatory Required to be Well - Formed

Well - Formed All XML documents must be Syntactically correct! Single root element All element start tags have end tags XML is case sensitive Properly nested tags //error //correct Attributes values in quotes “value“ or ‘value‘

Basic XML Parts Markup Tags Attributes, names and values Character Data Text PCDATA CDATA Binary XML document has two main sections Prolog Root Misc Optional and considered superfluous

Simple XML File Hello World! <!-- More Comments -->

Declaration If used: required Declaration optional Specifies version to which document conforms XML documents without XML declaration might be assumed to conform to the latest version Other declaration examples optional Default – Good for ASCII text – 8 bit characters “UTF-16” Good for foreign – 16 bit characters Used for Unicode characters To stay uniform use with 8 or 16 optional No external subset referenced – default

Comments <!-- More Comments --> XML uses same comment syntax as HTML

Root Element Lines preceding root element are contained in the Prolog All XML documents must contain only one root element All other elements are “child element”s

Child Element Hello World!

Sibling Element Hello World! Goodbye World! Nothing more to add!

Updating Microsoft’s Internet Explorer instmsia.exe Updates Microsoft’s Installer msxml3sp1.exe Updates Microsoft’s Internet Explorer IE now has built-in XML parser “msxml”

Create XML Document Include declaration Create root element Create child element Enter child element text “student name” Save file with “.xml” extension Open using Internet Explorer After success, add siblings elements and retest using Internet Explorer

Document viewed in Microsoft's Internet Explorer

More about Elements Element types Container Element Contains other elements Data Element Contains DATA Mixed Content Contains other elements and DATA Empty Element Contains no elements or DATA

Container Element Contains other elements Some text way down here in the center of it all

Data Element Contains DATA Parsable Character Data PCDATA Character Data CDATA

PCDATA Contains text Can be parsed by parser Can contain all text except < > “ ‘ &

Entity References XML provides built in entity references < > " &apos; &

CDATA Contains text Is a declaration Can contain reserved characters, “, ‘, & Starts with / ends with <![CDATA[ Data would be here ]]> CDATA can not contain ]]>

Declarations

Why CDATA section “C++” code example CDATA example If (this->getX() < 5 && array1[0] != 3) cerr displayError(); PCDATA example If (this->getX() < 5 && array1[0] != 3) cerr << this->displayError();

Mixed Content Elements and PCDATA combined outer element stuff inner element stuff more outer element stuff

Empty Element Contains no text or data May have an attribute Short cut notation for empty element Does this look unfamiliar HTML example of such a type of tag //Non Well Formed //Well Formed

Elements element Start-tag content End-tag

Create XML Document 2 Include declaration Create root element Create child element Enter child element text “student name” Create child element Child to root, sibling to Make this an empty element Create child element Child to root, sibling to Enter C++ code example in PCDATA section Create child element Enter same C++ code in a CDATA section Save file Open using Internet Explorer

XML Parser – DOM & SAX Required to process an XML document C, Java, Python, Perl Parsers are of type Document Object Model(DOM) Tree structure Like a drive directory structure Slower and requires large amounts of memory Simple API for XML(SAX) Events driven Events = tags, text, etc. Smaller, faster, but requires programmer to deal with data Validating and non-validating

XML Structure Logical structure Document divided into units Allows sub units XML is a logical tree structure document Physical structure Data stored inside document Data stored outside document Entities one example

Valid Conforms to some schema schema “s” Document Type Definition(DTD) Schema By definition, all valid XML documents are Well – Formed documents

DTD Document Type Definition Document Type Declaration(DTD) File extension of “.dtd” DTD is not an XML document DTD is a schema “s” Introduced into an XML document via the Document Type Declaration Three types of DOCTYPE declarations Internal Subset Contained in the Prolog External Subset Exist in different file Prolog contains reference to file containing DTD Referenced using key work SYSTEM or PUBLIC Internal Subset and External Subset combination

Internal Subset <!DOCTYPE document [ ]> Hello World! <!-- More Comments -->

External Subset Hello World! <!-- More Comments -->

DTD for HelloWorld.xml

Internal Subset and External Subset combination I <!DOCTYPE document SYSTEM "HelloWorld3.dtd"[ ]> <!-- More Comments -->

Internal Subset and External Subset combination II

Putting it all together HelloWorld3.dtd HelloWorld3.xml <!DOCTYPE document SYSTEM "HelloWorld3.dtd"[ ]> <!-- More Comments -->

XML Validator Type in HelloWorld3.xml

Create XML Document 3 Create root element Create child element of session1 Enter child element text “xml class” Create child element of session2 Enter child element text “class information” Create child element of session3 Enter child element text “more” Create DTD for this file dtd_info.dtd Reference file in XML document Save files Open validate_vbs.html Enter.xml file name Validate

Schema Schemas are XML documents Schemas can be manipulated via a parser More complicated than DTDs Schemas have “ElementType”s

Schema vs. DTD

Schema vs. DTD II

Schema vs. DTD III

Topics not covered NamespaceWhitespace XpathXpointer Xlink XSLXSLT SOAPDDI Web Services SMIL XHTML