XP 1Creating Web Pages with XML Tutorial 1 New Perspectives on XML Tutorial 1 – Creating an XML Document.

Slides:



Advertisements
Similar presentations
CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
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.
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
New Perspectives on Creating Web Pages with HTML
Lecture 2B: HTML and CSS IT 202—Internet Applications Based on notes developed by Morgan Benton.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 5 – XML Basic School of Architecture, Design Science and Planning Faculty of.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
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
Developing a Basic Web Page with HTML
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Introduce of XML Xiaoling Song CS157A. What is XML? XML stands for EXtensible Markup Language XML stands for EXtensible Markup Language XML is a markup.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
Creating a Basic Web Page
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
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.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
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.
WORKING WITH XSLT AND XPATH
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.
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.
Introduction to HTML Tutorial 1 eXtensible Markup Language (XML)
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
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.
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
Windows Presentation Foundation (WPF) Chapter 16 Dr. Abraham.
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.
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.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
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.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Understanding How XML Works Ellen Pearlman Eileen Mullin Programming the.
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 Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XML Technology. Emerging Importance of XML –HTML-tagging is display oriented. –XML-based content tagging has important uses: data mining role-oriented.
Objective: To describe the evolution of the Internet and the Web. Explain the need for web standards. Describe universal design. Identify benefits of accessible.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
XP 1 HTML Tutorial 1: Developing a Basic Web Page.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XP 1 New Perspectives on XML Tutorial 1 – Creating an XML Document Jason C. H. Chen, Ph.D. Professor of MIS School of Business Administration Gonzaga University.
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.
Connecting to External Data. Financial data can be obtained from a number of different data sources.
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.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
XML intro. 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.
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.
Tutorial 9 Working with XHTML
XML QUESTIONS AND ANSWERS
Creating an XML Document
Presentation transcript:

XP 1Creating Web Pages with XML Tutorial 1 New Perspectives on XML Tutorial 1 – Creating an XML Document

XP 2Creating Web Pages with XML Tutorial 1 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of a document. Because it is extensible, XML can be used to create a wide variety of document types.

XP 3Creating Web Pages with XML Tutorial 1 Introducing XML XML is a subset of a the Standard Generalized Markup Language (SGML) which was introduced in the 1980s. SGML is very complex and can be costly. These reasons led to the creation of Hypertext Markup Language (HTML), a more easily used markup language. XML can be seen as sitting between SGML and HTML – easier to learn than SGML, but more robust than HTML.

XP 4Creating Web Pages with XML Tutorial 1 The Limits of HTML HTML was designed for formatting text on a Web page. It was not designed for dealing with the content of a Web page. Additional features have been added to HTML, but they do not solve data description or cataloging issues in an HTML document. Because HTML is not extensible, it cannot be modified to meet specific needs. Browser developers have added features making HTML more robust, but this has resulted in a confusing mix of different HTML standards.

XP 5Creating Web Pages with XML Tutorial 1 Introducing XML HTML cannot be applied consistently. Different browsers require different standards making the final document appear differently on one browser compared with another.

XP 6Creating Web Pages with XML Tutorial 1 The 10 Primary XML Design Goals 1.XML must be easily usable over the Internet XML was developed with the Web in mind. XML supports major Web protocols such as HTTP and MIME 2.XML must support a wide variety of applications XML can be used for other applications such as databases, financial transactions, and voice mail

XP 7Creating Web Pages with XML Tutorial 1 The 10 Primary XML Design Goals 3.XML must be compatible with SGML because XML is a subset of SGML, many software tools developed for SGML cab be adapted to XML 4.It must be easy to write programs that process XML documents It is easy for nonprogrammers to write XML code

XP 8Creating Web Pages with XML Tutorial 1 The 10 Primary XML Design Goals 5.The number of optional features in XML must be kept small SGML supports a wide range of optional features and can be large and cumbersome. XML removed this aspect of SGML making it a more suitable Web-development tool 6.XML documents should be clear and easily understood Like HTML, XML documents are text files. The contents of an XML document follow a tree-like structure

XP 9Creating Web Pages with XML Tutorial 1 The 10 Primary XML Design Goals 7.XML documents should be clear and easily understood Like HTML, XML documents are text files. The contents of an XML document follow a tree-like structure 8.The XML design should be prepared quickly If the Web community adopted XML, it was going to be a viable alternative to HTML The W3C had to quickly settle on a design for XML before competing standards emerged

XP 10Creating Web Pages with XML Tutorial 1 The 10 Primary XML Design Goals Continued 9.The design of XML must be exact and concise XML can be easily processed by computer programs making it easy for programmers to develop programs 10.XML documents must be easy to create for XML to be practical, XML documents must be as easy to create as HTML documents

XP 11Creating Web Pages with XML Tutorial 1 XML Editors This figure shows available XML editors

XP 12Creating Web Pages with XML Tutorial 1 XML Parsers An XML processor (also called XML parser) evaluates the document to make sure it conforms to all XML specifications for structure and syntax. XML parsers are strict. It is this rigidity built into XML that ensures XML code accepted by the parser will work the same everywhere.

XP 13Creating Web Pages with XML Tutorial 1 XML Parsers Microsoft’s parser is called MSXML and is built directly in IE versions 5.0 and above. Netscape developed its own parser, called Mozilla, which is built into version 6.0 and above.

XP 14Creating Web Pages with XML Tutorial 1 Well-Formed and Valid XML Documents There are two categories of XML documents –Well-formed –Valid An XML document is well-formed if it contains no syntax errors and fulfills all of the specifications for XML code as defined by the W3C. An XML document is valid if it is well-formed and also satisfies the rules laid out in the DTD or schema attached to the document.

XP 15Creating Web Pages with XML Tutorial 1 The Document Creation Process This figure shows the document creation process

XP 16Creating Web Pages with XML Tutorial 1 Working with XML Applications XML has the ability to create markup languages, called XML applications. Many have been developed to work with specific types of documents. Each application uses a defined set of tag names called a vocabulary. This makes it easier to exchange information between different organizations and computer applications.

XP 17Creating Web Pages with XML Tutorial 1 XML Applications This figure shows some XML applications

XP 18Creating Web Pages with XML Tutorial 1 The Structure of an XML Document XML documents consist of three parts –The prolog –The document body –The epilog The prolog is optional and provides information about the document itself

XP 19Creating Web Pages with XML Tutorial 1 The Structure of an XML Document The document body contains the document’s content in a hierarchical tree structure. The epilog is also optional and contains any final comments or processing instructions.

XP 20Creating Web Pages with XML Tutorial 1 The Structure of an XML Document: Creating the Prolog The prolog consists of four parts in the following order: –XML declaration –Miscellaneous statements or comments –Document type declaration –Miscellaneous statements or comments This order has to be followed or the parser will generate an error message. None of these four parts is required, but it is good form to include them.

XP 21Creating Web Pages with XML Tutorial 1 The Structure of an XML Document: The XML Declaration The XML declaration is always the first line of code in an XML document. It tells the processor what follows is written using XML. It can also provide any information about how the parser should interpret the code. The complete syntax is: A sample declaration might look like this:

XP 22Creating Web Pages with XML Tutorial 1 The Structure of an XML Document: Inserting Comments Comments or miscellaneous statements go after the declaration. Comments may appear anywhere after the declaration. The syntax for comments is: This is the same syntax for HTML comments

XP 23Creating Web Pages with XML Tutorial 1 Elements and Attributes Elements are the basic building blocks of XML files. XML supports two types of elements: –Closed elements, and –empty elements

XP 24Creating Web Pages with XML Tutorial 1 Elements and Attributes A closed element, has the following syntax: Content Example: Miles Davis

XP 25Creating Web Pages with XML Tutorial 1 Elements and Attributes Element names are case sensitive Elements can be nested, as follows: Kind of Blue So What ((:22) Blue in Green (5:37)

XP 26Creating Web Pages with XML Tutorial 1 Elements and Attributes Nested elements are called child elements. Elements must be nested correctly. Child elements must be enclosed within their parent elements.

XP 27Creating Web Pages with XML Tutorial 1 Elements and Attributes All elements must be nested within a single document or root element. There can be only one root element. An open or empty element is an element that contains no content. They can be used to mark sections of the document for the XML parser.

XP 28Creating Web Pages with XML Tutorial 1 Elements and Attributes An attribute is a feature or characteristic of an element. Attributes are text strings and must be placed in single or double quotes. The syntax is: …

XP 29Creating Web Pages with XML Tutorial 1 Elements and Attributes: Adding elements to the Jazz.XML File This figure shows the revised document prolog { document elements

XP 30Creating Web Pages with XML Tutorial 1 Character References Special characters, such as the symbol for the British pound, can be inserted into your XML document by using a character reference. The syntax is: &#character;

XP 31Creating Web Pages with XML Tutorial 1 Character References Character is a entity reference number or name from the ISO/IEC character set. Character references in XML are the same as in HTML.

XP 32Creating Web Pages with XML Tutorial 1 Character References This figure shows commonly used character reference numbers

XP 33Creating Web Pages with XML Tutorial 1 Character References This figure shows the revised Jazz.XML file character reference

XP 34Creating Web Pages with XML Tutorial 1 CDATA Sections A CDATA section is a large block of text the XML processor will interpret only as text. The syntax to create a CDATA section is: <! [CDATA [ Text Block ] ]>

XP 35Creating Web Pages with XML Tutorial 1 CDATA Sections In this example, a CDATA section stores several HTML tags within an element named HTMLCODE: <![CDATA[ The Jazz Warehouse Your Online Store for Jazz Music ] ]>

XP 36Creating Web Pages with XML Tutorial 1 CDATA Sections This figure shows the revised Jazz.xml file CDATA section

XP 37Creating Web Pages with XML Tutorial 1 Displaying an XML Document in a Web Browser XML documents can be opened in Internet Explorer or in Netscape Navigator. If there are no syntax errors. IE will display the document’s contents in an expandable/collapsible outline format including all markup tags. Netscape will display the contents but neither the tags nor the nested elements.

XP 38Creating Web Pages with XML Tutorial 1 Displaying an XML Document in a Web Browser To display the Jazz.xml file in a Web browser: 1. Start the browser and open the Jazz.xml file located in the Tutorial.01/Tutorial folder of your Data Disk. 2. Click the minus (-) symbols. 3. Click the resulting plus (+) symbols.

XP 39Creating Web Pages with XML Tutorial 1 Displaying an XML Document in a Web Browser This figure shows the revised Jazz.XML file as seen in Internet Explorer 6.0 and Netscape 6.2

XP 40Creating Web Pages with XML Tutorial 1 Linking to a Style Sheet The easiest way to turn an XML document into a formatted document is to link the document to a style sheet. The XML document and the style sheet are combined by the XML processor to display a single formatted document.

XP 41Creating Web Pages with XML Tutorial 1 Linking to a Style Sheet There are two main style sheet languages used with XML: –Cascading Style Sheets (CSS) and Extensible Style Sheets (XSL) CSS is supported by most browsers and is relatively easy to learn and use. XSL is more powerful, but not as easy to use as CSS.

XP 42Creating Web Pages with XML Tutorial 1 Linking to a Style Sheet There are some important benefits to using style sheets: –By separating content from format, you can concentrate on the appearance of the document –Different style sheets can be applied to the same XML document –Any style sheet changes will be automatically reflected in any Web page based upon the style sheet

XP 43Creating Web Pages with XML Tutorial 1 Applying a Style to an Element To apply a style sheet to a document, use the following syntax: selector {attribute1:value1; attribute2:value2; …} selector is an element (or set of elements) from the XML document. attribute and value are the style attributes and attribute values to be applied to the document.

XP 44Creating Web Pages with XML Tutorial 1 Applying a Style to an Element For example: ARTIST {color:red; font-weight:bold} will display the text of the ARTIST element in a red boldface type.

XP 45Creating Web Pages with XML Tutorial 1 Creating Processing Instructions The link from the XML document to a style sheet is created using a processing statement. A processing instruction is a command that gives instructions to the XML parser.

XP 46Creating Web Pages with XML Tutorial 1 Creating Processing Instructions For example: Style is the type of style sheet to access and sheet is the name and location of the style sheet.

XP 47Creating Web Pages with XML Tutorial 1 The JW.css Style Sheet This figure shows the cascading style sheet stored in the JW.css file

XP 48Creating Web Pages with XML Tutorial 1 Linking to the JW.css Style Sheet This figure shows how to link the JW.css style sheet to the Jazz.xml file processing instruction to access the JW.css style sheet

XP 49Creating Web Pages with XML Tutorial 1 The Jazz.xml Document Formatted with the JW.css Style Sheet This figure shows the formatted Jazz.XML file