XML Partha Pratim.

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

History Leading to XHTML
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
CSE 190: Internet E-Commerce Lecture 17: XML, XSL.
IS 373—Web Standards Todd Will
Computer Information Systems Information Systems California State University Los Angeles Jongwook Woo CIS 561 Design of an E-Commerce Site XML Validation.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 5 – XML Basic School of Architecture, Design Science and Planning Faculty of.
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.
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.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
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 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.
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.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
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 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Presentation Topic: XML and ASP Presented by Yanzhi Zhang.
XML eXtensible Markup Language. Topics  What is XML  An XML example  Why is XML important  XML introduction  XML applications  XML support CSEB.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
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 _________.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
WEB APPLICATION DEVELOPMENT For More visit:
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.
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 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 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.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
XML A Language Presentation. Outline 1. Introduction 2. XML 2.1 Background 2.2 Structure 2.3 Advantages 3. Related Technologies 3.1 DTD 3.2 Schemas and.
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 –
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
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)
HTML PROJECT #1 Project 1 Introduction to HTML. HTML Project 1: Introduction to HTML 2 Project Objectives 1.Describe the Internet and its associated key.
Extensible Markup Language (XML) Pat Morin COMP 2405.
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.
In this session, you will learn to:
Creating a Well-Formed Valid Document
Tutorial 9 Working with XHTML
Tutorial 9 Working with XHTML
XML QUESTIONS AND ANSWERS
Project 1 Introduction to HTML.
Microsoft Office Illustrated
XML stands for Extensible Markup Language.
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Creating an XML Document
Introducing HTML & XHTML:
Tutorial 9 Working with XHTML
IEEM 5352 E-Enterprise Integration
XML Introduction By Hongming Yu Feb 6th, 2002.
What is XML?.
Allyson Falkner Spokane County ISD
Presentation transcript:

XML Partha Pratim

eXtensible Markup Language XML is a kind of a ‘Mark-up Language.’ Any markup language have: Tags and Elements: ex. <p> is a tag. and <p> with the text here </p> --- is an element. Attributes: ex. <tagname attribute = “value”>

“Standardized Generalized Markup Language.” (SGML) All Mark up languages are created from: “Standardized Generalized Markup Language.” (SGML) SGML became an international standard in 1986. SGML allows the authors to create and describe additional elements and attributes in a mark up language. HTML came from SGML, as did XML

HTML : Some Drawbacks Has fixed set of tags. You cannot create your own. Is only a presentation technology. Does not carry information about the meaning of the content held within its tags. Flat. No precedence among tags. High traffic volume. Ex. Sending large general sets of data across a network when only a small amount is required.

Closer Look. XML was designed to describe data Tags are not predefined in XML. You must define your own tags XML uses a Document Type Definition (DTD) or an XML Schema to describe the data XML with a DTD or XML Schema is designed to be self-descriptive

The main difference between XML and HTML XML was designed to carry data. XML is not a replacement for 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. HTML is about displaying information, while XML is about describing information

XML tags are case sensitive. Syntax XML tags are case sensitive. <?xml version="1.0" encoding="ISO-8859-1"?> <note>  Root element <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>  End of Root element.

Syntax (cont.) General Form: <root> <child> <subchild>.....</subchild> </child> </root> Example with attributes: <?xml version="1.0" encoding="ISO-8859-1"?> <note date="12/11/2002"> <to>Tove</to> <from>Jani</from> </note>

XML validation. XML with correct syntax is Well Formed XML. XML validated against a DTD is Valid XML. A "Well Formed" XML document is a document that conforms to the XML syntax XML DTD (Document Type Definition) A DTD defines the legal elements of an XML document. The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements.

XML Schema XML Schema is an XML based alternative to DTD. The schema is how we assign the data types to each tag and any attributes that are contained in the XML document. A schema is a structured document which must obey XML syntax rules. It is composed of a series of predefined tags and attributes that are part of the XML language and are used to set the data types for the values associated with our custom tags.

Schema (cont.) A schema can be part of the XML document or a separate file. Syntax: Schema The Schema tag serves as a container element that delimits the beginning and end of the schema. This tag must be closed and please note the exact spelling with regard to case.   xmlns The xmlns attribute is used to declare the schema XML namespace. The value is a URL or URN address that the browser will access to get information on how to parse and validate the code.  

Schema (cont.) xmlns:dt The xmlns:dt attribute is used to declare the data types of the schema XML namespace. The value is a URL or URN address that the browser will access to get information on the data types to allow code validation.   If you are using IE 5 to view your XML document, then you must include the xmlns and the xmlns:dt attributes exactly as displayed below:   <Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> ... </Schema>

An example with Schema Code for aquarium.xml: <?xml version="1.0"?> <aquarium xmlns="x-schema:aquariumSchema.xml">    <fish>neon tetra</fish> </aquarium> Code for aquariumSchema.xml: <Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <!-- since the fish element contains no elements or attributes --> <!-- we close using the space blackslash --> <ElementType name="fish" content="textOnly" dt:type="string" /> <!-- the aquarium element contains the fish element --> <!-- so we use a closing /ElementType tag --> <ElementType name="aquarium" content="mixed">    <element type="fish" /> </ElementType> </Schema>

Displaying an XML Document The data in an XML document cannot be directly displayed on a browser. Therefore we must apply additional technology to create an HTML page that contains the XML data. We will discuss two ways to do this: 1. Data Binding 2. Style sheets

Data Binding Internet Explorer 4 and 5 contain a DSO (Data Source Object) that permits displaying the data in an XML document on an HTML page by using the technology of client-side data binding. This involves: Taking the XML data from the server-side Transferring the data to the client-side Caching the data on the client-side for future access, And binding the data to an HTML tag. The data is treated like a record set in ADO and the data can be manipulated by using the various methods and properties of the ADO Recordset object.

Data Binding (cont.) Example: Code for the Xml document Our goal is to create an HTML page that displays the XML data for the date of birth (dob), name (name), and social security number (ssn) for one staff member at a time. Further, we want to be able to scroll through the list of staff members using navigation buttons and see the data for any staff members.

Data Binding (cont.) To accomplish this, we will: use the src attribute of an inline xml element to link our HTML page to the XML document. use the HTML span tag for the data binding. use the datasrc attribute to link the each span element to the xml element. use the datafld attribute to bind the specified XML data value to the span element. use previous and next input buttons to call data navigation functions. use the MoveNext and MovePrevious ADO methods to navigate our data. use the RecordCount and AbsolutePosition ADO properties to limit our data navigation so that we never go to BOF or EOF.

Data Binding (cont.) Source code <html> <title>Data Binding Example</title> <body> <xml id="xmlStaff" src="devguru_staff_list.xml"> </xml> <b>Use the buttons to scroll up and down the DevGuru Staff List</b> <br><br> NAME: <span datasrc="#xmlStaff" datafld="name"></span> <br> DOB: <span datasrc="#xmlStaff" datafld="dob"></span> <br> SSN: <span datasrc="#xmlStaff" datafld="ssn"></span> <br> <br> <input type="button" value="Previous" onclick="Previous()"> <input type="button" value="Next" onclick="Next()"> <script type="text/javascript"> function Previous()    {       if(xmlStaff.recordset.AbsolutePosition > 1)       xmlStaff.recordset.movePrevious();    } function Next()    {       if(xmlStaff.recordset.AbsolutePosition < xmlStaff.recordset.RecordCount)       xmlStaff.recordset.moveNext();    } </script> </body> </html>

Data Binding example (cont.) Display in IE5

Display using style sheets. Source code for cdCatalog.xml Source code for style sheet The CD Catalog formatted with the CSS file

End of XML? NO There certainly is a lot more to XML than what we have discussed. XML data can be embedded directly in an HTML page XML combined with ASP can perform very well to— Manipulate databases. Manipulate the W3C Document object model Dynamically create XML documents from a web page.

Why XML? Why mark up the data this way? An XML file is in pure text any application should be able to use it. Increases data readability significantly. Data transfer is easier E.g. An XML file containing information about books for sale can be transferred to different sections of the pub. Company. Any platform can be made to understand this file, and manipulate it.

Why XML (cont.) Gives data some abstraction. Since the tags themselves carry some meaning, the data is somewhat abstracted here. Displaying mechanisms do not clutter the algorithm. Style sheets (CSS), XSL or data binding can take care of display. Much easier to change the look of the web pages, since the only thing that needs to be changed is the style-sheets.

Still not convinced? Go on the web. XML is becoming increasingly a preferred choice over HTML. Check out some discussion boards. Plenty of valid reasons why people prefer XML.

Works Cited Beginning Active Server Pages 3.0 Wrox, 2000. Pages 820-885 www.devguru.com www.w3schools.com