CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang

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

CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
XML and Enterprise Computing. What is XML? Stands for “Extensible Markup Language” –similar to SGML and HTML –document “tags” are used to define content.
Document Type Definitions and Schemata We have seen several ways of using XML to markup a poem, but we could invent a host of other possible approaches.
ICS-FORTH 1 May 22, 2001 Christos Georgis The extensible markup language: An introduction to XML What is a XML document ? How do we check its validity.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
XHTML 16-Apr-17.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
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.
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
XML Introduction By Hongming Yu Feb 6 th, Index Markup Language: SGML, HTML, XML An XML example Why is XML important XML introduction XML applications.
Introduction to XML Rashmi Kukanur. XML XML stands for Extensible Markup Language XML was designed to carry data XML and HTML designed with different.
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
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.
Computer Sciences Department
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.
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.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
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.
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.
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.
HTML. WHAT IS HTML HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup language A markup language is a set of.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
These Questions are copied from
Introduction to XML Extensible Markup Language. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information.
 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.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
XML eXtensible Markup Language. Topics  What is XML  An XML example  Why is XML important  XML introduction  XML applications  XML support CSEB.
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 _________.
CIS 451: XML DTDs Dr. Ralph D. Westfall February, 2009.
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.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
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.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
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.
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.
HTML A brief introduction HTML1. HTML, what is? HTML is a markup language for describing web documents (web pages). HTML stands for Hyper Text Markup.
XP 1Creating Web Pages with XML Tutorial 1 New Perspectives on XML Tutorial 1 – Creating an XML Document.
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.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
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.
Creating an XML Document
Document Type Definition (DTD)
Presentation transcript:

CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang

The general structure of XML In XML, you define your own tags. If you need a tag or, that's no problem. If you want to use a tag, you'll have to define it's meaning. This definition is stored in a DTD (Document Type Definition). You can define your own DTD or use an existing one.

The general structure of XML Defining a DTD actually means defining a XML language. An alternative for a DTD is Schema. Often it's not necessary to display the data in a XML document. It's for instance possible to store the data in a database right away. If you want to show the data, you can. XML itself is not capable of doing so.

The general structure of XML But XML documents can be made visible with the aid of a language that defines the presentation. XSL (eXtensible Stylesheet Language) is created for this purpose. But the presentation can also be defined with CSS (Cascading Style Sheets).

XML Tags XML tags are created like HTML tags. There's a start tag and a closing tag. content The closing tag uses a slash after the opening bracket, just like in HTML. The text between the brackets is called an element. The following rules are used for using XML tags:

XML Tags –Tags are case sensitive. The tag differs from the tags and –Starting tags always need a closing tag –All tags must be nested properly –Comments can be used like in HTML: Between the starting tag and the end tag XML expects the content.

XML Tags 135 is a valid tag for an element amount that has the content 135 Besides a starting tag and a closing tag, you can use an empty tag. An empty tag does not have a closing tag. The syntax differs from HTML: With XML tags you define the type of data. But often data is more complex. It can consist of several parts.

XML: elements and sub elements To describe the element car you can define the tags mercedes. This model might look like this: volvo v40 green

XML: elements and sub elements Besides the element car three other elements are used: brand, type and color. Brand, type and color are sub-elements of the element car. In the XML-code the tags of the sub-elements are enclosed within the tags of the element car. Sub-elements are also called children.

XML documents The first line of an XML document is the XML declaration. It's a special kind of tag: The version 1.0 is the actual version of XML. The XML declaration makes clear that we're talking XML and also which version is used.

XML documents The version identification will become important after new versions of XML are used. All XML documents must have a root element. All other elements in the same document are children of this root element. The root element is the top level of the structure in an XML document.

XML documents content content

XML documents All elements must be nested. The level of nesting can be arbitrarily deep. A real XML page: 100

XML documents Ray Bradbury carrots

XML documents 10 Elements in XML can use attributes. The syntax is:....

Attributes The value of an attribute needs to be quoted, even if it contains only numbers. volvo The same information can also be defined without using attributes: volvo green

Attributes When possible try to avoid attributes. Data structures are more easily described in XML-tags. Software that checks XML-documents can do a better job with tags than with attributes. An XML document needs to be well formed. Well formed means that the document applies to the syntax rules for XML.

Well formed XML documents To be well formed a document needs to comply to the following rules: –it contains a root element –all other elements are children of the root element –all elements are correctly paired –the element name in a start-tag and an end-tag are exactly the same –attribute names are used only once within the same element

Valid XML documents To be of practical use, an XML document needs to be valid. To be valid an XML document needs to apply to the following rules: –The document must be well formed. (More on well formed in the previous page). –The document must apply to the rules as defined in a Document Type Definition (DTD), (More on DTD's in the next page)

Valid XML documents If a document is valid, it's clearly defined what the data in the document really means. There's no possibility to use a tag that's not defined in the DTD. Companies that exchange XML-documents can check them with the same DTD. Because a valid XML document is also well formed, there's no possibility for typo's in the tags.

Valid XML documents A valid XML-document has a structure that's valid. That's the part you can check. There's no check for the content. To use XML you need a DTD (Document Type Definition). A DTD contains the rules for a particular type of XML-documents. Actually it's the DD that defines the language.

XML: the DTD A DTD describes elements. It uses the following syntax: The text <! ELEMENT, followed by the name of the element, followed by a description of the element. For instance: This DTD description defines the XML tag.

XML: the DTD The description (#PCDATA) stands for parsed character data. It's the tag that is shown and also will be parsed (interpreted) by the program that reads the XML document. You can also define (#CDATA), this stands for character data. CDATA will not be parsed or shown.

XML: the DTD An element that contains sub elements is described thus: This means that the element car has two subtypes: brand and type. Each subtype can contain characters.

XML: the DTD If you use, the sub elements brand and type can occur once inside the element car. To change the number of possible occurrences the following indications can be used: –+ must occur at least one time but may occur more often –* may occur more often but may also be omitted –? may occur once or not at all

XML: the DTD The indications are used behind the sub element name. For instance: Empty elements get the description EMPTY. For instance that could define a separator line to be shown if the XML document appears in a browser.

XML: the DTD A DTD can be an external document that's referred to. Such a DTD starts with the text The address is an URL that points to the DTD. In the XML document you make clear that you'll use this DTD with the line:

XML: the DTD that should be typed after the line A DTD can also be included in the XML document itself. After the line you must type

XML: the DTD <!DOCTYPE name of root-element [ followed by the element definitions. The DTD part is closed with ]> XML is about defining data. With XML you can define documents that are understood by computers.

Presenting XML documents But to make these documents understandable to humans, your need to show them. Cascading Style sheets (CSS) offer possibilities to show XML. It works just like adding styles to HTML elements. The preferred solution is using XSL (eXtensible Style sheet Language).

Presenting XML documents XSL can convert XML documents into HTML. It can be used client side but the best solution is to use XSL server side. You can convert your XML documents to HTML, thus making them visible to any browser.