Introduction to XML and RSS

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 Craig Stewart Dr. Alexandra I. Cristea
1 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 1.
XML XML What XML is and what it means to me as a Computer Scientist By: Derek Edwards CS 376 March 10, 2003.
XML eXtensible Markup Language ©2010 Paula Schales.
INF201 Fall2010 Intro. to Info. Technologies Department of Informatics University at Albany – SUNY Original Source: w3schools.com Prepared by Xiao Liang,
IS 373—Web Standards Todd Will
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
DT228/3 Web Development Introduction to XML.
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
Introduction to XML: Yong Choi CSU Bakersfield.
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.
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Web 2.0: Concepts and Applications 3 Syndicating Content.
Introduction to XML This material is based heavily on the tutorial by the same name at
Chapter 14 Introduction to HTML
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.
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 Data Management Issues. Types of data Structured Structured Semi-structured Semi-structured.
Creating a Simple Page: HTML Overview
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
 Introduction to XML Introduction to XML  Features of XML Features of XML  Syntax of XML Syntax of XML  Syntax rules of XML document Syntax rules.
What is XML? XML stands for EXtensible Markup Language
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Pemrograman Berbasis WEB XML -Aurelio Rahmadian- Sumber: w3cschools.com.
Introduction to XML Data Management Issues. Types of data Structured Structured Semi-structured Semi-structured.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
Introduction to XML 1. XML XML started out as a standard data exchange format for the Web Yet, it has quickly become the fundamental instrument in the.
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
HTML INTRODUCTION, EDITORS, BASIC, ELEMENTS, ATTRIBUTES.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
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,
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
How do I use HTML and XML to present information?.
CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.
XML eXtensible Markup Language. Topics  What is XML  An XML example  Why is XML important  XML introduction  XML applications  XML support CSEB.
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 _________.
Windows Presentation Foundation (WPF) Chapter 16 Dr. Abraham.
1 Dr Alexiei Dingli XML Technologies XML. 2 XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
ECA 228 Internet/Intranet Design I Intro to Markup.
WEB APPLICATION DEVELOPMENT For More visit:
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
XML EXtensible Markup Language. Agenda Introduction to XML XML Rules XML Elements XML Attributes XML Validation XML Exercises XML Namespaces XML CDATA.
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.
What it is and how it works
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
CSC 101 Spring 2007 Kelly Schneider. Open Office  OpenOffice.org is a multiplatform and multilingual office suite and an open source project  Some functions.
XML Presented by Kushan Athukorala. 2 Agenda XML Overview Entity References Elements vs. Atributes XML Validation DTD XML Schema Linking XML and CSS XSLT.
ASHIMA KALRA  INTRODUCTION OF XML INTRODUCTION OF XML  XML FEATURES XML FEATURES  XML SYNTAX XML SYNTAX  XML ELEMENTS XML ELEMENTS  XML ATTRIBUTES.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
IS444: Modern software development tools Dr. Azeddine Chikh.
XML. HTML Before you continue you should have a basic understanding of the following: HTML HTML was designed to display data and to focus on how data.
XML Introduction to XML Extensible Markup Language.
Connecting to External Data. Financial data can be obtained from a number of different data sources.
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.
What is XML?.
14 XML.
Presentation transcript:

Introduction to XML and RSS Data Management Issues

Types of data Structured Semi-structured

Structured Data data is organized in entities ( tables) entities have attributes

Current Database World Structure Relational Database Management System (DBMS): everything is a table Query languages: SQL Software: MS Access, Oracle….

Example of a table (patients)

Example of a group of tables

MS Access Table Links

World of Web Data Easy document exchange Unstructured (or poorly structured) data Everything is a document No standard for query languages

World of Web Data Example An organization A publishes financial data on its web pages (HTML), generated from DBMS. A second organization B wants some financial analyses; can access only web data. A B HTML RDBMS

Semi-structured Data data can be of any type not necessarily following any format does not follow any rules is not predictable examples include text video sound images

Characteristics of Semi-Structured Data structure is irregular: missing or additional attributes parts of data lack structure, e.g., images some may yield little structure, e.g., plain text

Semi-structured Data Definition Data that is inherently self-describing and does not conform to an explicit and fixed schema is known as Semistructured Data Data Structure is contained within data itself

Example of Semi-Structured Data name: Peter Wood email: ptw@dcs.bbk.ac.uk, p.wood@bbk.ac.uk ------------------------------------------------------------------ name: first name: Mark last name: Levene email: mark@dcs.bbk.ac.uk name: Alex Smith affiliation: StFX

IMDB – A Motivating Example The Internet Movie Database is a classical example of a collection of semi-structured data Although the information pertaining to different movies may be essentially similar, their structure may be different! Let us consider an example movie database

An Example Movie Database

IMDB-Irregularity In Structure Different layout for movies and TV series Movie entries show Director, Writers and Stars TV entries show just Stars Captain Phillips (Movie) Lost (TV Series)

Traditional Data Management Universe of Discourse Model of the UoD Database Query

Post-Internet Data Management Universe of Discourse Retrieval? Data Query

XML – An Embodiment of Semi-structured Data XML can be used to represent semistructured data

What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML (tags) XML was designed to describe data XML tags are not predefined. You must define your own tags

The main difference between XML and HTML XML and HTML were designed with different goals: XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks. It is important to understand that XML is not a replacement for HTML.

XML does not DO anything Maybe it is a little hard to understand, but XML DOES NOT DO ANYTHING. XML is created to structure, store and to send information. The note has a header and a message body. It also has sender and receiver information. But still, this XML document does not DO anything. It is just pure information wrapped in XML tags. Someone must write a piece of software to send, receive or display it. <note> <to>John</to> <from>Mary</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>

XML is free and extensible XML tags are not predefined. You must "invent" your own tags. The tags used to mark up HTML documents and the structure of HTML documents are predefined. (like <b>, <i>, <h1>, etc.). XML allows authors to define their own tags and their own document structure. The tags in the example above (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document.

XML is used to Exchange Data With XML, data can be exchanged between incompatible systems. In the real world, computer systems and databases contain data in incompatible formats. One of the most time-consuming challenges for developers has been to exchange data between such systems over the Internet. Since XML data is stored in plain text format, XML provides a software- and hardware-independent way of sharing data.

XML can be used to Create new Languages XML is the mother of WAP( Wireless Application Protocol) and WML (The Wireless Markup Language). WML used to markup Internet applications for handheld devices like mobile phones. MathML, for creating Math formula and CML (Chemical Markup language), comicML ( for describing comic characters) and musicXML (for musical notes) is written in XML.

XML and Microsoft Office Starting with Office 2007, Microsoft changed the format of all Office documents. They are all saved in XML format. So a Word file is a ZIP folder holding a number of files including the text in XML format. Advantages: Small file size Compatibility with other software Older Word files have the extension DOC, new ones use DOCX

XML Syntax The syntax rules of XML are very simple and very strict. The rules are very easy to learn, and very easy to use. Because of this, creating software that can read and manipulate XML is very easy to do.

All XML elements must have a closing tag Elements or tags are basic blocks of any XML document With XML, it is illegal to omit the closing tag. In HTML some elements do not have to have a closing tag. The following code is legal in HTML: <p>This is a paragraph In XML all elements must have a closing tag, like this: <par>This is a paragraph</par>

XML tags are case sensitive Unlike HTML, XML tags are case sensitive. With XML, the tag <Letter> is different from the tag <letter>. Opening and closing tags must therefore be written with the same case: <Message>This is incorrect</message> <message>This is correct</message>

All XML elements must be properly nested Improper nesting of tags makes no sense to XML. In HTML some elements can be improperly nested within each other like this: <b><i>This text is bold and italic</b></i> In XML all elements must be properly nested within each other like this: <bold><italic> This text is bold and italic </italic></bold>

All XML documents must have a root element (tag) All XML documents must contain a single tag pair to define a root element. All other elements must be within this root element. All elements can have sub elements (child elements). Sub elements must be correctly nested within their parent element: <root> <child> <subchild>.....</subchild> </child> </root>

With XML, white space is preserved With XML, the white space in your document is not truncated. This is unlike HTML. With HTML, a sentence like this: Hello              my name is John, will be displayed like this: Hello my name is John, because HTML strips off the white space.

Element Naming XML elements must follow these naming rules: Names can contain letters, numbers, and other characters Names must not start with a number or punctuation character Names must not start with the letters xml (or XML or Xml ..) Names cannot contain spaces

Element Naming Any name can be used, no words are reserved, but the idea is to make names descriptive XML documents often have a corresponding database, in which fields exist corresponding to elements in the XML document. A good practice is to use the naming rules of your database for the elements in the XML documents.

Comments in XML The syntax for writing comments in XML is similar to that of HTML. <!-- This is a comment -->

XML Attributes XML elements can have attributes in the start tag, just like HTML. Attributes are used to provide additional information about elements. In HTML (and also in XML) attributes provide additional information about elements: <img src="computer.gif"> <a href="demo.asp">

XML Attributes Attribute values must always be enclosed in quotes <person sex="female">

XML Attributes Cont. <?xml version="1.0" encoding="UTF-8"?> <note date=12/11/2002> <to>John</to> <from>Mary</from> </note> ---------------------------------------------------------------------- <note date="12/11/2002"> The error in the first document is that the date attribute in the note element is not quoted. The first line in the document is the XML declaration

Use of Elements vs. Attributes Data can be stored in child elements or in attributes. Take a look at these examples: <person sex="female"> <firstname>Anna</firstname> <lastname>Smith</lastname> </person> -------------------------------------------------- <person> <sex>female</sex> In the first example sex is an attribute. In the last, sex is a child element. Both examples provide the same information.

Errors in XML will stop the XML program The World Wide Web Consortium (W3C) XML specification states that a program should not continue to process an XML document if it finds a validation error. The reason is that XML software should be easy to write, and that all XML documents should be compatible. With HTML it was possible to create documents with lots of errors (like when you forget an end tag). One of the main reasons that HTML browsers are so big and incompatible, is that they have their own ways to figure out what a document should look like when they encounter an HTML error. With XML this should not be possible.

XML and Web Browsers Internet Explorer 5.0+, Google Chrome & Firefox support XML

Viewing XML Files If you open an XML document in IE ( or other browsers), it will display the document with color coded root and child elements. A plus (+) or minus sign (-) to the left of the elements can be clicked to expand or collapse the element structure.   If you want to view the raw XML source, you must select "View Source" from the browser menu. If an erroneous XML file is opened, the browser will report the error.

Other Examples Viewing some XML documents will help you get the XML feeling. An XML CD catalog This is some CD collection, stored as XML data An XML plant catalog This is a plant catalog from a plant shop, stored as XML data. A Simple Food Menu This is a breakfast food menu from a restaurant, stored as XML data.

Why does XML display like this? XML documents do not carry information about how to display the data. Since XML tags are "invented" by the author of the XML document, browsers do not know if a tag like <table> describes an HTML table or a dining table. Without any information about how to display the data, most browsers will just display the XML document as it is.

The XML Rules (Summary) Single, unique root element Matching open/close tags Consistent capitalisation Correctly nested elements Attribute values enclosed in quotes <?xml version=“1.0”?> <company id=“4859”> <name>3Months.com</name> <type>Web Development</type> <address> <street>Wakefield st</street> <city>Wellington</city> <country>New Zealand</country> </address> </company> If a document conforms to the rules then it is well formed. An XML document is also known as an XML Instance

Authoring XML Documents A basic XML document is an XML element that can, but might not, include nested XML elements. Example: <books> <book ISBN=“123456789”> <title> Second Chance </title> <author> Matthew Dunn </author> </book> </books>

Use of XML and HTML together This is pure data in XML file This is a pure Format file to display the same data View the result with Google Chrome or IE 6+

Converting Relational Database to XML Example: Export the following data into XML and group books by store Relational Database: Store (sid, name, phone) Book (bid, title, authors) StoreBook (sid , bid, price, stock) Store Book StoreBook phone authors bid title sid name price stock

Converting Relational Database to XML (Cont’d) <store> <sid> 123 </sid> <name> Chapter </name> <phone> 429-8976</phone> <book> <title> The Da Vinci Code</title> <authors> Dan Brown</authors> <bid> 987</bid> </book> <book>…</book> … </store>

Examples example of database Example of database converted to XML

XML representation of a sample Movie Database <?xml version="1.0" encoding="ISO-8859-1“ standalone=“yes”?> <IMDb> <Movies> <Movie> <Title> The Notebook</Title> <Actor> Ryan Gosling</Actor> <Actor> Rachel McAdams</Actor> <Director> Nick Cassavetes</Director> </Movie> <Title> 300 </Title> <Actor> Gerard Butler</Actor> <Actor> Lena Headey </Actor> <Director> Zack Snyder</Director> </Movies> <TVShow> FRIENDS </TVShow> <TVShow> Seinfeld </TVShow> </IMDb>

Brief Introduction to RSS

RSS ( Really Simple Syndication) RSS is a family of web feed formats used to publish frequently updated digital content, such as blogs, news feeds or podcasts. Users of RSS content use programs called feed "readers" or "aggregators": the user "subscribes" to a feed by supplying to their reader a link to the feed; the reader can then check the user's subscribed feeds to see if any of those feeds have new content since the last time it checked, and if so, retrieve that content and present it to the user. RSS formats are specified in XML (a generic specification for data formats). RSS delivers its information as an XML file called an "RSS feed," "webfeed," "RSS stream," or "RSS channel".

RSS Feed representation On Web pages, web feeds (RSS) are typically linked with the word "Subscribe", an orange square, or a rectangle with the letters Or Many news aggregators such as msnbc.com publish subscription buttons for use on Web pages to simplify the process of adding news feeds.

Podcasting A podcast is a media file that is distributed over the Internet using syndication feeds, for playback on portable media players and personal computers. The term "podcast" is derived from Apple's portable music player, the iPod. Though podcasters' web sites may also offer direct download or streaming of their content, a podcast is distinguished from other digital audio formats by its ability to be downloaded automatically, using software capable of reading feed formats such as RSS.

Podcasting Podcasting is an automatic mechanism whereby multimedia computer files are transferred from a server to a client, which pulls down XML files containing the Internet addresses of the media files. In general, these files contain audio or video, but also could be images, text, PDF, or any file type. Example: StFX Posdcast

XML Joke Question: When should I use XML? Answer: When you need a buzzword in your resume.