XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.

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

Ali Alshowaish w3schools. XML documents use a self-describing and simple syntax: The first line is the XML declaration. It defines the XML version (1.0)
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.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
An Introduction to XML Based on the W3C XML Recommendations.
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
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
Introduction to XML: Yong Choi CSU Bakersfield.
Introduction XML Dr. Qusai Abuein June, 2012 XML Dr. Qusai Abuein 1 Part (I) XML Basics.
Introduction to XML This material is based heavily on the tutorial by the same name at
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.
Creating a Simple Page: HTML Overview
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
 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.
XML - DTD. The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA.
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.
These Questions are copied from
 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.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language  XML is a markup language for creating documents containing structured information.
CIS 275—Web App Dev I XML. 2 Introduction to XMLXML XML stands for ________________________. HTML was designed to display data. XML was designed to _________.
XML - DTD Week 4 Anthony Borquez. What can XML do? provides an application independent way of sharing data. independent groups of people can agree to.
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.
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.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
WEB APPLICATION DEVELOPMENT For More visit:
Consuming eXtensible Markup Language (XML) feeds.
XML 2 Prepared by / Nael Alian Uinverity of Palestine Re. 1.
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 EXtensible Markup Language. Agenda Introduction to XML XML Rules XML Elements XML Attributes XML Validation XML Exercises XML Namespaces XML CDATA.
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.
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.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
IS446: Internet Software Development Dr. Azeddine Chikh.
Well Formed XML The basics. A Simple XML Document Smith Alice.
ASHIMA KALRA  INTRODUCTION OF XML INTRODUCTION OF XML  XML FEATURES XML FEATURES  XML SYNTAX XML SYNTAX  XML ELEMENTS XML ELEMENTS  XML ATTRIBUTES.
Introduction to DTD A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list.
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.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
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.
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.
Javascript & jQuery XML.
What is XML?.
Presentation transcript:

XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009

Contents XML Tutorial Introduction to XML How Can XML be Used? XML Tree XML Syntax Rules XML Elements XML Attributes XML Validation Viewing XML Files Displaying XML with CSS 

XML Tutorial aXML stands for EXtensible Markup Language. XML was designed to transport and store data. XML is important to know, and very easy to learn. XML Document Example Tove Jani Reminder Don't forget me this weekend! 

Introduction to XML XML was designed to transport and store data. HTML was designed to display data. 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 tags are not predefined. You must define your own tags XML is designed to be self-descriptive 

Introduction to XML The Difference Between XML and HTML XML is not a replacement for HTML. XML and HTML were designed with different goals: XML was designed to transport and store data, with focus on what data is. HTML was designed to display data, with focus on how data looks. HTML is about displaying information, while XML is about carrying information. 

XML Does not DO Anything Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store, and transport information. The following example is a note to Tove from Jani, stored as XML: Tove Jani Reminder Don't forget me this weekend! The note above is quite self descriptive. It has sender and receiver information, it also has a heading and a message body. But still, this XML document does not DO anything. It is just pure information wrapped in tags. Someone must write a piece of software to send, receive or display it.  Introduction to XML

With XML You Invent Your Own Tags The tags in the previous example (like and ) are not defined in any XML standard. These tags are "invented" by the author of the XML document. That is because the XML language has no predefined tags. The tags used in HTML (and the structure of HTML) are predefined.\ HTML documents can only use tags defined in the HTML standard (like,, etc.). XML allows the author to define his own tags and his own document structure.  Introduction to XML

How Can XML be Used? XML is used in many aspects of web development, often to simplify data storage and sharing. XML Separates Data from HTML If you need to display dynamic data in your HTML document, it will take a lot of work to edit the HTML each time the data changes. With XML, data can be stored in separate XML files. This way you can concentrate on using HTML for layout and display, and be sure that changes in the underlying data will not require any changes to the HTML. With a few lines of JavaScript, you can read an external XML file and update the data content of your HTML. 

XML Tree An Example XML Document XML documents use a self-describing and simple syntax: Tove Jani Reminder Don't forget me this weekend! The first line is the XML declaration. It defines the XML version (1.0) and the encoding used (ISO = Latin-1/West European character set). The next line describes the root element of the document (like saying: "this document is a note"): 

XML Tree The next 4 lines describe 4 child elements of the root (to, from, heading, and body): Tove Jani Reminder Don't forget me this weekend! And finally the last line defines the end of the root element: You can assume, from this example, that the XML document contains a note to Tove from Jani. Don't you agree that XML is pretty self-descriptive? 

XML Syntax Rules The syntax rules of XML are very simple and logical. The rules are easy to learn, and easy to use. All XML Elements Must Have a Closing Tag In HTML, you will often see elements that don't have a closing tag: This is a paragraph This is another paragraph In XML, it is illegal to omit the closing tag. All elements must have a closing tag: This is a paragraph This is another paragraph 

XML Tags are Case Sensitive XML elements are defined using XML tags. XML tags are case sensitive. With XML, the tag is different from the tag. Opening and closing tags must be written with the same case: This is incorrect This is correct Note: "Opening and closing tags" are often referred to as "Start and end tags". Use whatever you prefer. It is exactly the same thing.  XML Syntax Rules

XML Elements Must be Properly Nested In HTML, you might see improperly nested elements: This text is bold and italic In XML, all elements must be properly nested within each other: This text is bold and italic In the example above, "Properly nested" simply means that since the element is opened inside the element, it must be closed inside the element.  XML Syntax Rules

XML Documents Must Have a Root Element XML documents must contain one element that is the parent of all other elements. This element is called the root element  XML Syntax Rules

XML Attribute Values Must be Quoted XML elements can have attributes in name/value pairs just like in HTML. In XML the attribute value must always be quoted. Study the two XML documents below. The first one is incorrect, the second is correct: Tove Jani The error in the first document is that the date attribute in the note element is not quoted.  XML Syntax Rules

Entity References Some characters have a special meaning in XML. If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element. This will generate an XML error: if salary To avoid this error, replace the "<" character with an entity reference: if salary < 1000 then There are 5 predefined entity references in XML: < < less than > > greater than & & ampersand &apos; ‘ apostrophe " “ quotation mark  XML Syntax Rules

Comments in XML The syntax for writing comments in XML is similar to that of HTML. White-space is Preserved in XML HTML truncates multiple white-space characters to one single white- space: HTML: Hello my name is Tove Output: Hello my name is Tove. With XML, the white-space in a document is not truncated.  XML Syntax Rules

XML Elements An XML document contains XML Elements. What is an XML Element? An XML element is everything from (including) the element's start tag to (including) the element's end tag. An element can contain other elements, simple text or a mixture of both. Elements can also have attributes. Harry Potter J K. Rowling 

In the previous example, and have element contents, because they contain other elements. has text content because it contains text. In the previous example only has an attribute (category="CHILDREN").  XML Elements

XML Naming Rules XML elements must follow these naming rules: Names can contain letters, numbers, and other characters Names cannot start with a number or punctuation character Names cannot start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces Any name can be used, no words are reserved.  XML Elements

XML Attributes XML elements can have attributes in the start tag, just like HTML. Attributes provide additional information about elements. XML Attributes From HTML you will remember this:. The "src" attribute provides additional information about the element. In HTML (and in XML) attributes provide additional information about elements: 

XML Attributes Must be Quoted Attribute values must always be enclosed in quotes, but either single or double quotes can be used. For a person's sex, the person tag can be written like this: or like this:  XML Attributes

XML Elements vs. Attributes Take a look at these examples: Anna Smith female Anna Smith In the first example sex is an attribute. In the last, sex is an element. Both examples provide the same information. There are no rules about when to use attributes and when to use elements.  XML Attributes

XML Validation Well Formed XML Documents A "Well Formed" XML document has correct XML syntax. The syntax rules were described in previous: XML documents must have a root element XML elements must have a closing tag XML tags are case sensitive XML elements must be properly nested XML attribute values must be quoted Tove Jani Reminder Don't forget me this weekend! 

Viewing XML Files Raw XML files can be viewed in all major browsers. Don't expect XML files to be displayed as HTML pages. Viewing XML Files - Tove Jani Reminder Don't forget me this weekend! 

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 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.  Viewing XML Files

Displaying XML with CSS With CSS (Cascading Style Sheets) you can add display information to an XML document. Displaying your XML Files with CSS? It is possible to use CSS to format an XML document. Next is an example of how to use a CSS style sheet to format an XML document: 

Take a look at this XML file: The CD catalog  Displaying XML with CSS

Then look at this style sheet: The CSS file  Displaying XML with CSS

Finally, view: The CD catalog formatted with the CSS file The line links the XML file to the CSS file:  Displaying XML with CSS

Thank You!  Thank You! Questions?