1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.

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.
XML and Enterprise Computing. What is XML? Stands for “Extensible Markup Language” –similar to SGML and HTML –document “tags” are used to define content.
 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.
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
XML eXtensible Markup Language. HTML is not extensible One defect of HTML is that it is not extensible In HTML we cannot, for example, define notions.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
XML A brief introduction ---by Yongzhu Li. XML --- a brief introduction 2 CSI668 Topics in System Architecture SUNY Albany Computer Science Department.
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.
Tutorial 11 Creating XML Document
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
Introduction to XML: Yong Choi CSU Bakersfield.
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
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
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
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.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
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.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Week 1 Understanding the Web Design Environment. 1-2 HTML: Then and Now HTML is an application of the Standard Generalized Markup Language Intended to.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
3 XHTML.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
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,
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.
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.
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.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
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.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
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.
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 –
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes The Web Wizard’s Guide to XHTML by Cheryl M. Hughes.
SCHOOL OF LIBRARY, ARCHIVE AND INFORMATION STUDIES Andy Dawson LIS1510 Library and Archives Automation Issues XML and extensible systems Andy Dawson School.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Unit 3 — Advanced Internet Technologies Lesson 10 — Introduction to XHTML.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
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.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
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
XML QUESTIONS AND ANSWERS
Chapter 7 Representing Web Data: XML
Presentation transcript:

1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University of Newcastle Netskills is a trademark of Netskills, University of Newcastle.

2 © Netskills Quality Internet Training, University of Newcastle Topics What is XML? Mark-up languages SGML, HTML and XML Advantages of XML over SGML & HTML Structuring data with XML Creating well formed XML documents Tags, Elements and Attributes XML declaration Document Type Definition (DTD) Namespaces Displaying XML documents

3 © Netskills Quality Internet Training, University of Newcastle What is XML eXtensible Markup Language Very powerful internet technology The core of a suite of technologies used for management, display and exchange of data Associated technologies include: XSL – eXtensible Style Language XPath - language for addressing parts of an XML document DOM – standardised Document Object Model

4 © Netskills Quality Internet Training, University of Newcastle Mark-up Languages Originally developed for printing electronic documents Mark-up tags to allow processing software to determine the formatting, structure or meaning of marked up data Most have been developed from SGML Standard Generalised Mark-up Language ISO standard since 1986 Complex, rigid but widely used meta-language Unsuited to data interchange on the internet

5 © Netskills Quality Internet Training, University of Newcastle HTML and XML HTML (Hyper Text Mark-up Language) Only intended for displaying documents in an HTML browser Originally created using SGML for web delivery Finite, predetermined set of tags Limited information about what the data represents Several different versions of the language XML (eXtensible Mark-up Language) A simplified version (subset) of SGML for users to create their own mark-up language Therefore it is not a new version of HTML but a different concept

6 © Netskills Quality Internet Training, University of Newcastle XHTML This is the new version of HTML W3C Recommendation since Jan 2000 XML was designed to describe data and HTML was designed to structure data for display XHTML combines strengths of both XHTML documents are HTML web pages that can also be treated as XML documents Can be read by all XML enabled devices Should work in all HTML browsers By using XHTML you prepare for future browser and software development

7 © Netskills Quality Internet Training, University of Newcastle Advantages of XML Developers can create their own tags Complete flexibility to structure data in any way for any application Self-describing language e.g. Joe Bloggs Separates the data content from presentation XML document contains no information on how the data is to be displayed Display handled by separate style sheets XML provides a mechanism for structuring and describing data

8 © Netskills Quality Internet Training, University of Newcastle Structuring Data with XML Hierarchical structure Relationships between data items called elements Two main relationships parent/child is a parent of "William" is a child of sibling/sibling and are siblings Structure often referred to as the document tree Macbeth William Shakespeare

9 © Netskills Quality Internet Training, University of Newcastle Tags and Elements Macbeth William Shakespeare Christine Stephen King One document or root element Opening & Closing tags (case sensitive) Element Tags must be nested correctly (cannot overlap) White space is preserved in text

10 © Netskills Quality Internet Training, University of Newcastle Using Attributes Attributes are simple name/value pairs associated with an element Macbeth William Shakespeare Elements can have more than one attribute Use of attributes is mainly a matter of preference and purpose Attribute Value - matching " or ' quotes Name

11 © Netskills Quality Internet Training, University of Newcastle XML Declaration Identifies the document to the XML processor (parser) Must be at the beginning of the document Macbeth William Shakespeare XML declaration is optional, but should be included as a matter of good practice

12 © Netskills Quality Internet Training, University of Newcastle Further Details Comments Empty elements All elements must have a start and end tag Empty elements can be represented by

13 © Netskills Quality Internet Training, University of Newcastle Well-formed or Valid? A well-formed document A document that complies to the basic structure required by the XML standard is a well-formed document All XML documents must be well-formed They will not work otherwise! A valid document A well-formed document that also conforms to structuring rules defined in an associated DTD or XML Schema Valid documents are crucial for ensuring consistent and reliable data exchange

14 © Netskills Quality Internet Training, University of Newcastle DTD and Schema DTD (Document Type Definition) SGML mechanism for specifying rules for structure and content of marked up documents Elements, Data, Attributes, Default values etc. DTD is part of the XML 1.0 specification - very widely used Any XML document can be validated against a DTD to ensure that it obeys the rules DTD not written using XML and once created are inflexible XML Schema Re-formulation of the principles of DTD for XML "A DTD written in XML" Schemas are also XML documents Flexible and extendible Multiple schemas per document Becoming more widely used as tools become available

15 © Netskills Quality Internet Training, University of Newcastle XML Namespaces Mechanism to identify subsets of XML elements Can be used as a unique reference to identify subsets and consider them in context e.g. Documents using the same element names for different purposes Dr Macbeth Large documents with sets of elements to be used by different processes Two types of namespace declaration URL is used to provide unique reference Default namespaces xmlns=" Prefixed namespaces xmlns:books="

16 © Netskills Quality Internet Training, University of Newcastle Namespace Syntax people.xml DR John Smith books.xml Christine Stephen King loans.xml <loans xmlns:person=" xmlns:item=" DR John Smith Christine Stephen King Context given by prefixes Namespace is declared using the xmlns attribute of the root element. A prefix is used. All elements that use the prefix belong in this namespace

17 © Netskills Quality Internet Training, University of Newcastle DR John Smith Christine Stephen King Default Namespaces Namespace is declared using the xmlns attribute of the element. No prefix is used so all the children of now belong in this namespace A different default namespace is applied here to all of the elements within the element

18 © Netskills Quality Internet Training, University of Newcastle Displaying XML Documents An XML document contains no information about how to display the data it describes Style sheets are used to apply display formatting to an XML document Cascading Style Sheets (CSS) Also used with HTML Extensible Style Sheet Language (XSL) Specifically designed for XML

19 © Netskills Quality Internet Training, University of Newcastle Using Style Sheets Document - books.xml <?xml-stylesheet type="text/css"  href="bookstyle.css"?> Macbeth William Shakespeare Style Sheet - bookstyle.css booklist {background-color:yellow} book {display:block;} title {font-size:24pt;} author {font-size:20pt;} firstname {display:none;} lastname {color:blue;} Documents delivered to the client which applies formatting XML processing instruction to call a style sheet

20 © Netskills Quality Internet Training, University of Newcastle Summary XML is a very powerful internet technology Allows authors to create their own markup tags and determine the formatting, structure or meaning of data XML documents must be well formed Rules for structure and content of valid XML documents are specified in a DTD or Schema XML namespaces are used to give context to elements of the same name used for different purposes XML separates data content from presentation Presentation of data is handled by style sheets