XML Extensible Markup Language. Introduction to XML Text based format As JSON it’s mainly intended for data interchange (transport & store) Also widely.

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

CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XSL XSLT and XPath 11-Apr-17.
INF201 Fall2010 Intro. to Info. Technologies Department of Informatics University at Albany – SUNY Original Source: w3schools.com Prepared by Xiao Liang,
XML Extensible Markup Language Standard supported by W3C (World Wide Web Consortium) HTML – End user oriented (presentation) XML – Application oriented.
INTRODUCTION The Group WEB BROWSER FOR RELATION Goals.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
Introduction to XML: Yong Choi CSU Bakersfield.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
Internet Applications Spring Review Last week –MySQL –Questions?
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.
XML, CFMX CFML & SQL XML Kevin Penny, MMCP
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
s Advance Database Systems Week-2 Dr.Kwanchai Eurviriyanukul
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
WORKING WITH XSLT AND XPATH
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.
Demystifying the eXtensible Markup Language Nick Roberts & Jim Few
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 About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
MySQL Databases & PHP Integration Using PHP to write data to, and retrieve data from, a MySQL database.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
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.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
XML Basics A brief introduction to XML in general 1XML Basics.
Jennifer Widom XML Data Introduction, Well-formed XML.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
ACG 4401 XSLT Extensible Stylesheet Language for Transformations Presenting XML and XBRL.
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.
Martin Kruliš by Martin Kruliš (v1.1)1.
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
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.
JSON JavaScript Object Notation. Introduction (What is JSON?) A lightweight text based data-interchange format Language independent Subset of JavaScript.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations Presenting XML and XBRL.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
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.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
XSLT: The XML transformation language
Visual Classification of Football Teams
Unit 4 Representing Web Data: XML
The Object-Oriented Thought Process Chapter 11
Introduction to Dynamic Web Programming
XML in Web Technologies
XSLT 1.0.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
Tutorial 6 PHP & MySQL Li Xu
Introduction to World Wide Web
Presentation transcript:

XML Extensible Markup Language

Introduction to XML Text based format As JSON it’s mainly intended for data interchange (transport & store) Also widely used for document content and information structure formatting Much like HTML but tags are not predefined and self-descriptive

XML vs HTML XML – data and structure descriptions, storage, and transportation – Not to replace HTML HTML – data view layout and presentation

XML Syntaxes Users can define their own element’s tags Tags are case sensitive Must have single root element Sub elements must be properly nested Element with attribute must has its attribute value quoted (attribute=“value…?”)

XML Syntaxes...

XML Syntaxes

Example How to represent student’s table data below using JSON? Student basic element structure (“Brendan Eich”): Brendan Eich AC NameMatric No.CourseworkFinal Exam Brendan EichAC Rasmus LerdofAC

Example If we make “coursework” and “final exam” as sub elements of parent element let say “marks” and also add the attribute “dev” for student Brendan Eich AC

Example Complete student list in XML format: JSON counterpart: [ { "name":"Brendan Eich", "matric_no":"AC123", "marks": {"cw": 50, "fe": 25 } }, { "name":"Rasmus Lerdof", "matric_no":"AC456", "marks": {"cw": 55, "fe": 30 } } ] Brendan Eich AC Rasmus Lerdof AC

Transforming XML to HTML via XSLT student_list.xml <?xml-stylesheet type="text/xsl" href="student_list.xsl"?> Brendan Eich AC Rasmus Lerdof AC student_list.xsl Browser HTML Output [1] [2] [3]

Transforming XML to HTML via XSLT student_list.xsl Student List Name Matric No. Do notice that student_list.xsl itself is just another type of XML document

Client-Server Implementation (AJAX, PHP, MySQL, XML, JavaScript, & XSLT) The Architecture: Client Server createXML.php MySQL DB Table student_list.html student_list.xsl AJAX (GET) AJAX (text/xml) AJAX (GET)AJAX (text/xml) Transform(); [1] [2] [3] [4] [5] [6]

Client-Server Implementation (MySQL, PHP, XML, JavaScript, & XSLT) MySQL: create table student ( matric_no varchar(15) not null, name varchar(15) not null, cw smallint default 0, fe smallint default 0, primary key (matric_no) ); insert into student values ('AC123', 'Brendan Eich', '50', '25'); insert into student values('AC456', 'Rasmus Lerdof', '55', '30');

Client-Server Implementation (MySQL, PHP, XML, JavaScript, & XSLT) PHP - part 1 (createXML.php): <?php header("Content-type:text/xml"); header("Access-Control-Allow-Origin: *"); // Connect to db and query student table items. $dbconn = mysql_connect("localhost", "login", "password"); mysql_select_db("db_name", $dbconn); $query = mysql_query("select * from student", $dbconn); // Create SimpleXMLElement instance. $xml = new SimpleXMLElement(' ');...

Client-Server Implementation (MySQL, PHP, XML, JavaScript, & XSLT) PHP - part 2 (createXML.php):... while ($row = mysql_fetch_assoc($query)) { $student = $xml->addChild("student"); $student->addChild("name", $row["name"]); $student->addChild("matric_no", $row["matric_no"]); $marks = $student->addChild("marks"); $marks->addChild("cw", $row["cw"]); $marks->addChild("fe", $row["fe"]); } mysql_close($dbconn); echo $xml->asXML(); ?> $xml $student $marks

Client-Server Implementation (MySQL, PHP, XML, JavaScript, & XSLT) HTML - part 1 (student_list.html): $(document).ready(function() { Transform(); });...

Client-Server Implementation (MySQL, PHP, XML, JavaScript, & XSLT) HTML - part 2 (student_list.html):... function Transform() { // Download XML data from the server side. var xml = getXMLData(" // Get XSL template at the client side. var xsl = getXMLData("student_list.xsl"); // Only for Mozilla based browsers. xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); var result = xsltProcessor.transformToFragment(xml, document); $("body").append(result); }...

Client-Server Implementation (MySQL, PHP, XML, JavaScript, & XSLT) HTML - part 3 (student_list.html):... function getXMLData(url) { return $.ajax({type:"GET", url:url, async:false}).responseXML; }