Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C1.

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

Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C1.
XML Craig Stewart Dr. Alexandra I. Cristea
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
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.
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
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
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.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
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.
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.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
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.
WPF chapter 15 Dr. John Abraham Professor UTPA. WPF –an introduction WPF provides a single platform capable of handling graphics, audio and video. WPF.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Pemrograman Berbasis WEB XML -Aurelio Rahmadian- Sumber: w3cschools.com.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
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.
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?.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
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.
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.
WEB APPLICATION DEVELOPMENT For More visit:
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.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
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.
IS446: Internet Software Development Dr. Azeddine Chikh.
XML Presented by Kushan Athukorala. 2 Agenda XML Overview Entity References Elements vs. Atributes XML Validation DTD XML Schema Linking XML and CSS XSLT.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
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 –
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.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Introduction to XML Extensible Markup Language.
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
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)
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.
What is XML?.
Presentation transcript:

Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C1

2 Lecturers Alexandra I. Cristea Hugh Darwen: Zabin Visram:

3 Schedule Usual: –Tue 14-15, H0.52 –Thu 13-14, LIB2 –Fri 13-14, PLT Exceptions: –Others: TBA: check forum, website, course

4 Slides Thanks to: –W3C courses –Others: mentioned directly

5 Contact Forum: IF (and ONLY IF) a question is personal, you might address it to –FORMAT: subject of should contain ‘CS253’ and topic of the (otherwise it will be filtered out)

6 Course site(s): Current: – /CS253/ /CS253/ –Will contain current slides, as taught at the course –Will contain notifications: check BEFORE & AFTER the course Official: – s253.htmlhttp:// s253.html

7 Content: Topics 1.SQL: Missing Info without Nulls – Hugh Darwen 2.SQL: Concurrency – Zabin Visram 3.XML 4.XML Query languages 5.RDF 6.RDF Query languages 7.OWL 8.Q&A, Exam preparation

8 Books & Material Korth and Silberschatz, Database System Concepts, McGraw-Hill,1991. Ullman J D, Principles of Database Systems (Vols 1 and 2), Computer Science Press,1988. Online material from W3C and W3C schools a.o. (as mentioned in the slides and notes check also the notes in the powerpoints)

9 Purpose of this course A selection of topics related to databases A more modern view on current database implementation & research

10 Overlaps and sequencing Form: optional Prerequisites –CS252: Fundamentals of Database Systems –Optional: CS253: Topics in Database Systems –(actual previous CS233: Database Systems)

11 Organization of the course 7.5 CATS CS, CSE, CBS, Mathematics ~ 15 1-hour lectures Exam at the end: 2 hours Rules of the game: –Read also comments on the slides and additional reading material. –Presence is optional, but beware: slides-only are NOT ENOUGH to learn from for the exam; you need to participate, take your own notes, so self- study!

12 Scope of CS 253 A selection of topics on current database systems, As well as a selection of topics not covered in the fundamental course part What this course is not: –This course is not an exhaustive course on database topics –This course has no seminars or practical part, so it is based on lectures and self-study only

13 XML

14 XML history Inception: circa 1996 The Extensible Markup Language (XML) became a W3C Recommendation 10. February 1998.

15 What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to describe data XML is more of a standard and supporting structure than a standalone programming language – wrong!

16 How does XML work? XML tags are not predefined. 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

17 Main Difference XML, 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. Syntax: XML is well formed, just like XHTML

18 XML does not DO anything XML was created to structure, store and to send information John Jane Reminder Don't forget the book!

19 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. The author of HTML documents can only use tags that are defined in the HTML standard (like,, etc.). XHTML is XML but not vice-versa.

20 Benefits XML extensibility and structured nature of XML allows it to be used for communication between different systems from one source of XML-based information you can format and distribute it via a multitude of different channels – XSL files act as templates, allowing a single stylesheet to be used to format multiple pages or the same content for multiple distribution channels

21 XML is a Complement to HTML XML is not a replacement for HTML. –In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data. XML is a cross-platform, software and hardware independent tool for transmitting information.

22 XML in Future Web Development XML is going to be everywhere. the XML standard has been developed quickly and a large number of software vendors have adopted it. XML might be the most common tool for all data manipulation and data transmission.

23 XML Can be Used to Create New Languages XML is the mother of WAP and WML. The Wireless Markup Language (WML), used to markup Internet applications for handheld devices like mobile phones, is written in XML. And many others …

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

25 Viewing XML to view XML documents hierarchically or view their output, you need an XML parser and processor. there are a number of these tools available: See examples at: Please note, however: XML was not designed to display data.

26 The basic XML flow

27 XML Rules 1.Every start-tag must have a matching end-tag. 2.Tags cannot overlap. Proper nesting is required. 3.XML documents can only have one root element. 4.Element names must obey the following XML naming conventions: a)Names must start with letters or the "_" character. Names cannot start with numbers of punctuation characters. b)After the first character, numbers and punctuation characters are allowed.

28 XML Rules (cont.) c)Names cannot contain spaces. d)Names should not contain the ":" character as it is a "reserved" character. e)Names cannot start with the letters "xml" in any combination of case. f)The element name must come directly after the "<" without any spaces between them. 5.XML is case sensitive. 6.XML preserves white space within text. 7.Elements may contain attributes. If an attribute is present, it must have a value, even if it is an empty string "".

29 Spot the error! Tove Jani

30 Spot the error! Tove Jani

31 With XML, CR / LF is converted to LF Windows: CR + LF Unix: LF Macintosh: CR

32 There is Nothing Special About XML plain text w XML tags Software that can handle plain text can also handle XML. In an XML-aware application, the XML tags can be handled specially: –Visibility, –Functional meaning, etc.

33 Is this an error? Tove Jani Don't forget me this weekend! Reminder

34 XML Elements have Relationships Elements are related as parents and children. Root element / Parents Children / Siblings

35 Elements An element consists of all the information from the beginning of a start-tag to the end of an end-tag including everything in between. E.g. from (X)HTML, all of the following would be the equivalent of one element, named h1: This is a heading. –Where, is the start tag, is the end tag, and the content is in between. Each XML document has a root element within which all other elements are nested.

36 Examples See at: – 402/ij_02_10_04a.htmlhttp:// 402/ij_02_10_04a.html – egIntAdv.xmlhttp://prolearn.dcs.warwick.ac.uk/caf/gipfB egIntAdv.xml –Search more by yourself and familiarize yourself with the syntax!

37 XML Attributes XML elements can have attributes. From HTML you will remember this: The SRC attribute provides additional information about the IMG element.

38 Attributes versus Elements Anna Smith female Anna Smith

39 Comments same as in any other languages with line(s) of code whose sole purpose is to provide the developer, and anyone reading the code in the future, information about the code.

40 XML Validation: Well Formed-ness An XML document is well formed, if all the XML rules are obeyed. (with 7 XML rules as defined in slides 27-28)

41 XML declaration Every XML document begins with a declaration (not mandatory, good practice) Or, using optional attributes:

42 Document Type Definition (DTD) which tags and attributes are allowed, where they can be placed, and whether or not they can be nested within a given document.

43 Document Type Declaration (DOCTYPE) Root document URL to DTD (external subset via a system identifier)

44 Internal vs External DTD declaration Internal: ]> External, public:

45 Valid XML Documents A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD): Tom Jane Reminder Don't forget me this weekend!

46 Validator syntax-check any XML file:syntax-check any XML file dator.asp

47 Internal DTD <!DOCTYPE note [ ]> Tove Jani Reminder Don't forget me this weekend!

48 External DTD >> saved as file note.dtd

49 XML Schema (XSD) XML Schema is an XML based alternative to DTD. W3C supports an alternative to DTD called XML Schema:

50 Displaying your XML Files with CSS? It is possible to use CSS to format an XML document. Example: XML file: The CD catalogThe CD catalog style sheet: The CSS fileThe CSS file product: The CD catalog formatted with the CSS fileThe CD catalog formatted with the CSS file Below is a fraction of the XML file. The second line,, links the XML file to the CSS file

51 Displaying XML with XSL XSL is the preferred style sheet language of XML. XSL (the eXtensible Stylesheet Language) is far more sophisticated than CSS. examples: –View the XML file, the XSL style sheet, and View the result.View the XML filethe XSL style sheetView the result

52 XML Conclusions We have learned: –XML history –What it is –How it works –Differences to (X)HTML –XML flow –XML Rules –XML Elements, Relationships, Attributes, Comments –Well-formed-ness concept –XML supporting frame: XML Schema or DTD –Generics on displaying XML

53 Next we are looking into more specific information about how to display XML and more, with …

54 XSL

55 XSL XSL is an XML-based language used for stylesheets that can be used to transform XML documents into other document types and formats. XSL is a family of recommendations for defining XML document transformation and presentation. It consists of three parts.

56 XSL parts: XSL Transformations (XSLT)XSLT –a language for transforming XML XML Path Language (XPath)XPath –an expression language used by XSLT to access or refer to parts of an XML document. (XPath is also used by the XML Linking specification)XML Linking XSL Formatting Objects (XSL-FO)XSL-FO –an XML vocabulary for specifying formatting semantics

57 Conclusion XSL We have learned: –What is XSL –What are its parts Next: –Not all parts are equally important –We look at the most important one …

58 XSLT

59 XSLT XSLT became a W3C Recommendation 16. November most important part of XSL transforms input document (source tree) into a particular way in a specified output document (result tree). built on a structure known as an XSL template: e.g., this selects one/all movies Multiple templates: first the root template; if that doesn’t match, the next, etc. XPath

60 XSLT Browsers nearly all major browsers support XML and XSLT. Mozilla Firefox –v 1.0.2, Firefox has support for XML and XSLT (and CSS). Mozilla –XML + CSS. Namespaces. Available with an XSLT implementation. Netscape –v 8, uses the Mozilla engine. Opera –v 9, XML, XSLT (and CSS). V 8 only XML + CSS. Internet Explorer –v 6, XML, Namespaces, CSS, XSLT, and XPath. V 5 NOT ! compatible

61 XSLT Elements in common use used as root element of nearly all XSLT stylesheets. Version number: current number of XSLT specification from W3C.W3C xmlns is the path to the XML Namespace defined by the W3C for the XSLT Transformation language. Currently, that path is

62 Example Correct Style Sheet Declaration <xsl:stylesheet version="1.0" xmlns:xsl=" <xsl:transform version="1.0" xmlns:xsl="

63 Example use of template My CD Collection Title Artist.. XML: xsl/cdcatalog.xml xsl/cdcatalog.xml Result: ls.com/xsl/cdcatalog_with_ ex1.xmlhttp:// ls.com/xsl/cdcatalog_with_ ex1.xml

64 XSLT Elements in common use (2) call other templates repeatedly insert specified content from source tree into result tree output method to use, e.g., xml, text, or html.

65 Pull method: value-of My CD Collection Title Artist.. View the XML fileView the XML file, View the XSL fileView the XSL file, and View the resultView the result

66 Push method: apply-templates My CD Collection Title: Artist: View the XML fileView the XML file, View the XSL file, and View the result.View the XSL fileView the result

67 XSLT Elements in common use (3) dynamically create generic elements during the transformation process insert some specified text (PCDATA)

68 XSLT Elements in common use (4) evaluate an expression; if true, the contents are evaluated. Some content or XSL elements here more flexibility: one of any number of choices + default choice

69 Example choose: Result number one. Result number two. The default result.

70 XSLT Elements in common use (5) loop for a set of nodes; to form template within template. take sections of source tree and copy them directly to the result tree

71 Why an XML Editor? XML Schema to define XML structures and data types XSLT to transform XML data SOAP to exchange XML data between applications WSDL to describe web services RDF to describe web resources XPath and XQuery to access XML data SMIL to define graphics Altova's XMLSpy –30 days free trial –

72 Conclusions XSLT We have learned: –XSLT Definition –Correct style sheet declaration –XSLT common elements –Looked at some examples –Browsers and their support for XSLT and more –About XML editors for editing XSLT and more

73 Next: –We look at how to access elements and attributes inside the XML (for XSLT and more) –This can be done via … –XPATH