Introduction to XML: Part I By Sandeep Jangity CS 157B, Section 2 Dr. Lee.

Slides:



Advertisements
Similar presentations
XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
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.
An Introduction to XML Based on the W3C XML Recommendations.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 24.
History Leading to XHTML
1 XML DTD & XML Schema Monica Farrow G30
Tutorial 9 Working with XHTML
An Introduction to XML Schema CSCI 7818 by Ming Rutar.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
XML Schemas Lecture 10, 07/10/02. Acknowledgements A great portion of this presentation has been borrowed from Roger Costello’s excellent presentation.
XML, XSL, XSLT, XHTML and others By Sean Hunter. Why XML?  XML was created to be a quick and easy way to provide structured data over the web.  Existing.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 6 – XML Schema School of Architecture, Design Science and Planning Faculty of.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
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.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 5 – XML Basic School of Architecture, Design Science and Planning Faculty of.
XML(EXtensible Markup Language). XML XML stands for EXtensible Markup Language. XML is a markup language much like HTML. XML was designed to describe.
Tutorial 11 Creating XML Document
Introduction to XML: Yong Choi CSU Bakersfield.
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
Introduction to XML This material is based heavily on the tutorial by the same name at
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
17 Apr 2002 XML Schema Andy Clark. What is it? A grammar definition language – Like DTDs but better Uses XML syntax – Defined by W3C Primary features.
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.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Schemas Ellen Pearlman Eileen Mullin Programming the Web Using XML.
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: The Changing Phase of e-Documentation Jyothi Jandhyala.
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
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
10/15/20151 XML. 10/15/20152 Mark-up Languages Digitalizing information Content Format SGML HTML XML RDF OWL …
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
Of 33 lecture 3: xml and xml schema. of 33 XML, RDF, RDF Schema overview XML – simple introduction and XML Schema RDF – basics, language RDF Schema –
XML 2nd EDITION Tutorial 1 Creating An Xml 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.
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
XML – Part III. The Element … This type of element either has the element content or the mixed content (child element and data) The attributes of the.
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.
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.
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.
XML Basics A brief introduction to XML in general 1XML Basics.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
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.
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 –
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.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
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)
Extensible Markup Language (XML) Pat Morin COMP 2405.
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.
XML QUESTIONS AND ANSWERS
Introduction to XML: Part I
Presentation transcript:

Introduction to XML: Part I By Sandeep Jangity CS 157B, Section 2 Dr. Lee

Overview What is XML? Why XML is popular? How to write a XML document? How to write XML DTD’s/Schemas?

What is XML? eXtensible Markup Language XML is a standard developed by the W3C XML is a syntax for expressing structured data in a text format XML is not a language on its own. Instead, XML is used to build markup languages. XML is like html per-se, but unlike html tags, XML tags convey meaning of the data inside their tags

Structured Data Structured data refers to data that is tagged for its content, meaning, or use Includes: spreadsheets, address books, databases, PDF documents, … Stored in binary or text format

XML Technology Model Data is modeled in XML The structure and constraints are modeled using DTD’s or Schemas The document format can be modeled using XSL (XML Style Sheets) REMEMBER: XML allows us to separate data from presentation!

Why use XML? Interoperability – XML is operating system, platform, language independent Separates content from presentation Well supported by most browsers Simple XML documents are human-readable and can be easily parsed by machines, as well. Easily converted to other formats. XML->PDF || Microsoft CHM etc., Can represent almost any kind of data –Many, many applications: Math/Science/etc., –(continued: next slide)

MyMathML 4 + (5 * 3) add 4 mult 5 3

MyChemML ChemML (tracking experiments) The compound under investigation is common water: It boils at 100 degrees and freezes at 0 degrees! For more information about this amazing compound see the March 2003 issue of: Water World (Now the technical stuff)

XML document syntax Root element Elements and attributes are case sensitive Elements must be correctly nested Attributes values must be in quotes Tags must be closed Spaces are not allowed in element and attribute names

XML Example John Doe Introduction to XML 12 June XYZ Foo Bar Introduction to XSL 12 June ABC

Well-formed vs Valid Syntax & Semantic checking Well-formed (syntax): –Properties: (1) every start tag has a matching end tag, and (2) elements are properly nested –an XML document might be “well-formed” without being “valid“, but a “valid” document is “well-formed” Valid (semantic): –A valid XML document conforms to the vocabulary constraints defined in a DTD or Schema

Well-Formed (cont’d) Well formed? Bill Sue Dinner tonight?

Definition and Validation Two ways to define the structure of an XML document –DTDs –Schemas Each set of rules specifies an XML vocabulary

What is a DTD? Document Type Definitions (DTD) –Emphasis on the structure of the XML, what elements and attributes can appear and their relationships –Difficult to work with –No support for data types –Not extensible

Bookstore Example John Doe Introduction to XML 12 June XYZ Foo Bar Introduction to XSL 12 June ABC

Problems with DTD’s It's not XML syntax You write your XML document using one syntax and the DTD using another syntax -> inconsistent, more work for the parsers. Limited set of primitive datatypes Desire a set of datatypes compatible with those found in databases –One of the main weaknesses of DTD is its lack of support for data types beyond character strings (PCDATA). Limited support for applying constraints. Can support only constraints like “+” (1 or more occurences), “?” (0 or 1 occurences), “*” (0 or more occurences), etc. No facility for providing constraints like those found in databases (enumerations, ranges, string length, etc.)

What are Schemas? Schemas –More complex than DTD’s –Specify structure –Support for precise data type constraints –Allows for user-defined data types (complex/simple types) –Enhanced datatypes (unlike PCDATA in DTD’s): Wider range of primitive data types, supporting those found in databases (string, boolean, decimal, integer, date, etc.) Can create your own datatypes (complexType) –Support namespaces for extensibility

Schema Example (next SLIDE) John Doe Introduction to XML 12 June XYZ Foo Bar Introduction to XSL 12 June ABC

< xsd:schema xmlns:xsd =“ targetNamespace=" xmlns =“

XML Namespaces: Code-reuse Namespaces –Identifies an XML vocabulary defined by a URI (Uniform Resource Identifier) –Allows reuse of XML markup –Resolves problems with recognition and collision of tags with similar names. Can happen if your combining elements from multiple documents. (see previous slide)

Cool XML Application: RSS XML.com XML.com features a rich mix of information and services for the XML community. en-us Normalizing XML, Part 2 In this second and final look at applying relational normalization techniques to W3C XML Schema data modeling, Will Provost discusses when not to normalize, the scope of uniqueness and the fourth and fifth normal forms. The.NET Schema Object Model Priya Lakshminarayanan describes in detail the use of the.NET Schema Object Model for programmatic manipulation of W3C XML Schemas.

?? Almost done …

TOools/Software XML Spy By far, the most comprehensive editor. Handles XML files, DTD’s, XSL files, as well as XSD (XML Schema). Unfortunately only a 30 day trial version. XML Notepad Microsoft XML Notepad is a simple application for building and editing small sets of XML-based data. Freeware. XML Pro XML Pro is a top-notch XML editor but it doesn’t include as many features as XML Spy. Shareware. $$ You can also validate your XML files by just opening them with IE5.0 or above. It checks if the XML file is well-formed or not, and also validates against a DTD (if specified on the DOCTYPE declaration Great links:

Conclusion You thought HTML was easy? XML just got easier!  Get XML certified before you graduate! Visit: article.html Questions