Structured-Document Processing Languages Spring 2007 Course Review Repetitio mater studiorum est!

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

XML III. Learning Objectives Formatting XML Documents: Overview Using Cascading Style Sheets to format XML documents Using XSL to format XML documents.
XML: Extensible Markup Language
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
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.
31 Signs That Technology Has Taken Over Your Life: #6. When you go into a computer store, you eavesdrop on a salesperson talking with customers -- and.
XML DOM and SAX Parsers By Omar RABI. Introduction to parsers  The word parser comes from compilers  In a compiler, a parser is the module that reads.
1 COS 425: Database and Information Management Systems XML and information exchange.
XML A brief introduction ---by Yongzhu Li. XML --- a brief introduction 2 CSI668 Topics in System Architecture SUNY Albany Computer Science Department.
COS 381 Day 16. Agenda Assignment 4 posted Due April 1 There was no resubmits of Assignment Capstone Progress report Due March 24 Today we will discuss.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Copyright © 2002 ProsoftTraining. All rights reserved. XML Document Design.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Scientific Markup Languages Birds of a Feather A 10-Minute Introduction to XML Timothy W. Cole Mathematics Librarian & Professor of.
1 XML at a neighborhood university near you Innovation 2005 September 16, 2005 Kwok-Bun Yue University of Houston-Clear Lake.
Structured-Document Processing Languages Spring 2011 Course Review Repetitio mater studiorum est!
Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards.
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.
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
Sheet 1XML Technology in E-Commerce 2001Lecture 7 XML Technology in E-Commerce Lecture 7 XSL Formatting Objects, Java Data Binding.
XML Transformations Eugenia Fernandez IUPUI. Stylesheet Technologies Browser-based Presentation HTML Cascading Stylesheets Programming-based Transformation.
Structured-Document Processing Languages Spring 2005 Course Review Repetitio mater studiorum est!
Advanced Java Session 9 New York University School of Continuing and Professional Studies.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
1 XML - Extensible Markup Language. 2 HTML - Hypertext Markup Language n HTML has a fixed tag set. n Use these tags to describe how information is to.
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
SDPL 2001Notes 4: Intro to Stylesheets1 4. Introduction to Stylesheets n Discussed recently: –Programmatic manipulation of (data-oriented) documents n.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter X IXXXXXXXXXX XXXXXX.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Scripting with the DOM Ellen Pearlman Eileen Mullin Programming the Web.
SDPL 20112: XML Basics1 2 Basics of XML and XML documents Survivor's Guide to XML, or XML for Computer Scientists / Dummies 2.1 XML and XML documents 2.2.
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.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
Structured-Document Processing Languages (3 cu), Spring 2004 Pekka Kilpeläinen University of Kuopio Department of CS & Applied Math
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
SDPL 2002Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human-oriented.
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 –
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
SDPL 20064: Introduction to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –(APIs for) procedural manipulation of documents n Now.
When we create.rtf document apart from saving the actual info the tool saves additional info like start of a paragraph, bold, size of the font.. Etc. This.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
Structured-Document Processing Languages Spring 2004 Course Review Repetitio mater studiorum est!
Martin Kruliš by Martin Kruliš (v1.1)1.
Structured-Document Processing Languages (3 cu/6 ECTS cp), Spring 2007 Pekka Kilpeläinen University of Kuopio Department of Computer Science
SDPL 2004Notes 4: Intro to Style Sheets1 4. Introduction to Style Sheets n Discussed recently: –Programmatic manipulation of documents n Now a more human.
Structured-Document Processing Languages (5 cp), Spring 2011 Pekka Kilpeläinen University of Eastern Finland School of Computing
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
XML: Extensible Markup Language
Unit 4 Representing Web Data: XML
Java XML IS
{ XML Technologies } BY: DR. M’HAMED MATAOUI
XML in Web Technologies
Database Processing with XML
Introduction to Internet Programming
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
More XML XML schema, XPATH, XSLT
Presentation transcript:

Structured-Document Processing Languages Spring 2007 Course Review Repetitio mater studiorum est!

SDPL 2007Course Review2 Goals of the Course n Learn about central models and languages for –manipulating –representing –transforming and –querying structured documents (or XML) n "Generic XML processing technology"

SDPL 2007Course Review3 Methodological Goals n Central professional skills –consulting technical specifications –experimenting with SW implementations n Ability to think…? –to find out relationships –to apply knowledge in new situations n ("Pidgin English" for scientific communication)

SDPL 2007Course Review4 XML? n Extensible Markup Language is not a markup language! –does not fix a tag set nor its semantics (like markup languages like HTML do) n XML is –A way to use markup to represent information –A metalanguage »supports definition of specific markup languages through XML DTDs or Schemas »E.g. XHTML a reformulation of HTML using XML

SDPL 2007Course Review5 XML Encoding of Structure: Example <S> S E <W><W></W> </E>Helloworld! W Hello W world! </W> </S> A=1

SDPL 2007Course Review6 Basics of XML DTDs n A Document Type Declaration provides a grammar (document type definition, DTD) for a class of documents Syntax (in the prolog of document instance): [ ]> Syntax (in the prolog of document instance): [ ]> n DTD = union of the external and internal subset

SDPL 2007Course Review7 How do Declarations Look Like? <!ATTLIST item price NMTOKEN #REQUIRED unit (FIM | EUR) ”EUR” >

SDPL 2007Course Review8 Element type declarations The general form is where E is a content model The general form is where E is a content model  regular expression of element names n Content model operators: E | F : alternationE, F: concatenation E? : optionalE* : zero or more E+ : one or more(E) : grouping

SDPL 2007Course Review9 XML Schema Definition Language n XML syntax –schema documents easier to manipulate by programs (than the DTD syntax) n Compatibility with namespaces –can validate documents using declarations from multiple sources n Content datatypes –44 built-in datatypes (including primitive Java datatypes, datatypes of SQL, and XML attribute types) –+ user-defined datatypes

SDPL 2007Course Review10 XML Namespaces </xsl:template></xsl:stylesheet>

SDPL 2007Course Review11 3. XML Processor APIs n How can applications manipulate structured documents? –Overview of document parser interfaces 3.1 SAX: an event-based interface 3.2 DOM: an object-based interface 3.3 JAXP: Java API for XML Processing

SDPL 2007Course Review12 A SAX-based application Application Main Routine startDocument() startElement() characters() Parse() Callback Routines endElement() </A>Hi! "A",[i="1"] "Hi!" "A"

SDPL 2007Course Review13 DOM: What is it? n Object-based, language-neutral API for XML and HTML documents –Allows programs/scripts to »build »navigate and »modify documents n “Directly Obtainable in Memory” vs “Serial Access XML”

SDPL 2007Course Review14 <invoice form="00" type="estimated"> type="estimated"> John Doe John Doe Pyynpolku 1 Pyynpolku KUOPIO KUOPIO DOM structure model invoice name addressdata address form="00"type="estimated" John Doe streetaddresspostoffice KUOPIO Pyynpolku 1... Document Element NamedNodeMap Text

SDPL 2007Course Review15 Overview of XSLT Transformation

SDPL 2007Course Review16 JAXP (Java API for XML Processing) n An interface for “plugging-in” and using XML processors in Java applications –includes packages »org.xml.sax: SAX 2.0 interface »org.w3c.dom: DOM Level 2 interface »javax.xml.parsers: initialization and use of parsers »javax.xml.transform: initialization and use of transformers (XSLT processors) n Included in standard Java

SDPL 2007Course Review17 XML.getXMLReader() JAXP: Using a SAX parser (1) f.xml.parse( ”f.xml”) ”f.xml”).newSAXParser()

SDPL 2007Course Review18 f.xml JAXP: Using a DOM parser (1).parse(”f.xml”).newDocument().newDocumentBuilder()

SDPL 2007Course Review19 XSLT JAXP: Using Transformers (1).newTransformer(…).transform(.,.)

SDPL 2007Course Review20 4. Introduction to Style Sheets n Specify and produce visual representation for structured documents n by defining a mapping from document structure+content to formatting tasks, and –inserting/generating new text –numbering –rearranging n by rules based on contextual conditions

SDPL 2007Course Review21 Process of Transformation (muunnos) Formatter input Transformation TeX FOT (XSL formatting object tree) Style sheet - Latex style file, CSS, XSLT

SDPL 2007Course Review22 Process of Formatting (muotoilu) n Creates a detailed description of presentation –> style sheet may not have complete control of the final formatted presentation!

SDPL 2007Course Review23 Process of Rendering (hahmonnus) n Display/play the document on output medium

SDPL 2007Course Review24 CSS - Cascading Style Sheets n A stylesheet language –mainly to specify the representation of web pages by attaching style (fonts, colours, margins, …) to HTML/XML documents Example style rule: H1 {color: blue; font-weight: bold;} Example style rule: H1 {color: blue; font-weight: bold;}

SDPL 2007Course Review25 CSS Processing Model (simplified) 0. Parse the document 1. Match style rules to elements of the doc tree –annotate each element with values assigned for properties »inheritance and elaborate "cascade" rules applied to select which value is assigned 2. Generate a formatting structure –of nested rectangular boxes 3. Render the formatting structure –display, print, audio-synthesize,...

SDPL 2007Course Review26 XSL: Transformation & Formatting XSLT script I II

SDPL 2007Course Review27 Page regions A simple page can contain 1-5 regions, specified by child elements of the simple-page-master A simple page can contain 1-5 regions, specified by child elements of the simple-page-master

SDPL 2007Course Review28 Top-level formatting objects n Slightly simplified: fo:root fo:layout-master-set (fo:simple-page-master | fo:page-sequence-master)+ fo:page-sequence + fo:region- body fo:region- before? fo:region-after? fo:region-end? fo:region- start? specify masters for page sequences, by referring to simple-page-masters contents of pages fo:flow

SDPL 2007Course Review29 XQuery in a Nutshell n Functional expression language –A query is a side-effect-free expression n Operates on sequences of items –atomic values or XML nodes Strongly-typed: (XML Schema) types may be assigned to expressions statically, and results can be validated Strongly-typed: (XML Schema) types may be assigned to expressions statically, and results can be validated n Extends XPath 2.0 ( but not all axes required) –common for XQuery 1.0 and XPath 2.0: »Functions and Operators, W3C Rec. 01/2007 n Roughly: XQuery  XPath XSLT' + SQL'

SDPL 2007Course Review30 FLWOR ("flower") Expressions n for, let, where, order by and return clauses (~SQL select-from-where) n Form: (ForClause | LetClause)+ WhereClause? OrderByClause? "return" Expr n binds variables to values, and uses these bindings to construct a result (an ordered sequence of nodes)

SDPL 2007Course Review31 XQuery Example for $pn in distinct-values( doc(”sp.xml”)//pno) let $sp:=doc(”sp.xml”)//sp_tuple[pno=$pn] where count($sp) >= 3 order by $pn return {$pn} {$pn} {avg($sp/price)} {avg($sp/price)}

SDPL 2007Course Review32 Course Main Message n XML is a universal way to represent information as tree-like data structures n Specialized and powerful technologies for processing it –Worst hype has settled –R&D still active