A presentation by Robin Upton (2009-10-04) ‏ Latest version at www.altruists.org/ff106 Attribution – NonCommercial - ShareAlike www.altruists.org FF106:

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

Chungnam National University DataBase System Lab
Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
Internet Technologies1 1 Lecture 4: Programming with XSLT.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XPath Eugenia Fernandez IUPUI. XML Path Language (XPath) a data model for representing an XML document as an abstract node tree a mechanism for addressing.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
XSLT XML DBs, and Schemas Week 18 DSA. The Whisky Case study XSLT can be applied in the client. –Add a xml processing instruction to the xml to bind to.
Introduction to XLink Transparency No. 1 XML Information Set W3C Recommendation 24 October 2001 (1stEdition) 4 February 2004 (2ndEdition) Cheng-Chia Chen.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
A note on generating text with the xsl:value-of instruction.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
Object Oriented Programming III1 XSLT Processing XML using XSLT Using XPath.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Introduction to XPath Bun Yue Professor, CS/CIS UHCL.
SD2520 Databases using XML and JQuery
ECA 228 Internet/Intranet Design I Intro to XSL. ECA 228 Internet/Intranet Design I XSL basics W3C standards for stylesheets – CSS – XSL: Extensible Markup.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
Lecture 6 of Advanced Databases XML Schema, Querying & Transformation Instructor: Mr.Ahmed Al Astal.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
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.
WORKING WITH XSLT AND XPATH
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
FF 1 : Modules A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
A presentation by Robin Upton ( ) ‏ latest version at Attribution – NonCommercial - ShareAlike FF 404.
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.
Processing of structured documents Spring 2003, Part 7 Helena Ahonen-Myka.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
A presentation by Robin Upton ( ) ‏ latest version at Attribution – NonCommercial - ShareAlike FF 4 :
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Lecture 11 XSL Transformations (part 1: Introduction)
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike FF 10.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
FF 12 : Clients A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
FF 11 : Hooks A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
FF 17 : Processes A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike Recommended.
XSLT I Robin Burke ECT 360. Outline History / Terminology XSLT processing XSLT syntax XPath XSLT basics Lab.
1 Whitespace Handling Roger L. Costello XML Technologies.
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 Schema – XSLT Week 8 Web site:
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.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
CH 15 XSL Transformations 1. Objective What is XSL? Overview of XSL transformations Understanding XSL templates Computing the value of a node with xsl:value-of.
Unit 4 Representing Web Data: XML
Displaying XML Data with XSLT
Querying and Transforming XML Data
Chapter 7 Representing Web Data: XML
Presentation transcript:

A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike FF106: Other Processing Directives Recommended Pre-requisite: FF6: Common Processing Directives v

F2F servers are programmed with items, with a function attribute to indicate which service is requested. Service Request Model The f2f:escaped & f2f:sendescaped attributes modify the default processing order. * This namespace is omitted for brevity from this point on. Attributes to modify requests are called Processing Directives. This presentation details the less common ones.

Interpreting a has 3 steps, apart from the transforms themselves. Processing Directive Sequence XSL transform or CORE service Raw Output Post- processed Output Pre- processed Input servicereq Raw Input servicereq Pre- processing directives: Mid- processing directives: pre-deserialize pre-validate pre-test {,-select} pre-skip pre-skip-shallow pre-update- {, -name, -namespace, -value} pre-order pre-sort {,-data-types,-keys,-order} pre-select pre-select-shallow this-return this-validate this-order this-skip this-skip-shallow this-update {, -name, -namespace, -value} this-sort {,-data-types, -keys, -order} this-select this-select-shallow this-xml-space this-escape this-escape-node this-insert {, -source{,-shallow}, -method} Raw Final Output Post- processed Final Output Post- processing directives: post-validate post-order post-skip post-skip-shallow post-update {,-name,-namespace, -value} post-sort {,-data-types, -keys, -order} post-select post-select-shallow post-xml-space post-escape-node Descendant XSL stylesheet Possible

Pre-Processing Directives pre-deserialize pre-validate pre-test pre-test-select pre-test-select-shallow pre-order pre-skip pre-skip-shallow pre-update- {, -name, -namespace, -value} pre-sort{,-data-types, -keys, -order} pre-select pre-select-shallow XSL transform or CORE service Pre- processed Input servicereq Raw Input servicereq Pre-processing directives: The following directives apply to the input document, before processing...

Mid-Processing Directives The following directives apply to the output of the first processing step... this-return this-validate this-order this-skip this-skip-shallow this-update {,-as,-namespace} this-sort {, -data-types, -keys, -order} this-select this-select-shallow this-xml-space this-escape this-escape-node this-insert {, -source{,-shallow}, -method} First XSL transform or CORE service Raw Output Post- processed Output Mid-processing directives:

Post-Processing Directives Post directives apply to the final output of all servicereqs created by the original request: post-validate post-order post-skip post-skip-shallow post-update {, -name, -namespace, -value} post-sort {,-data-types, -keys, -order} post-select post-select-shallow post-xml-space post-escape-node XSL transform or CORE service Raw Output Post- processed Output Mid-processing directives: Raw Final Output Post- processed Final Output Post-processing directives: Processing all offspring servicereqs. Descendant XSL stylesheets or CORE services

@pre-deserialize : Deserializing Text Nodes This converts serialized XML back into XML: pre ` <location>//false- flags.xml “//text()” is usually set to “//text()”, which deserializes all text nodes. It is used to allow continued processing of serialized XML content, such as that returned by calls to the f2f:core template.

@this-escape : Escaping with Attributes This specifies which output nodes to add escaping attributes to: mid ` is usually set to “/*”, to prevent any further processing. (Behaviour for “/” is currently “/*” Nodes which already have this attribute are unchanged.

@*-order : Modifying Order of Processing Directives This directive changes the order of subsequent processing directives. This directive is a superior alternative to attaching p.d.’s to a nested set of pre, mid, post <servicereq function=" this-select=”//f2f:item[2]” this-skip=”//f2f:item[2]” this-order=”select skip”> Reichstag Fire Sep 11th Attacks Tonkin “//f2f:item[2]” Sep 11th “//f2f:item[2]” Reichstag Fire Tonkin Gulf Tonkin Gulf Sep 11th Attacks

@this-return : Ignoring Return of Data If =0, this directive instructs the thread not to await the servicereq’s “0” is useful for operations which take a long time, such as callouts to other servers, since alternatives such wait for the service to complete. mid Although coded, it is not much needed yet, since F2F servers do not yet call out directly to other servers.

: Sorting This performs an XSL-style sort on the data. Both attributes are needed. pre, mid, avoids need for XSL sorting, especially handy for callouts. Reichstag Fire Sep 11th Attacks Tonkin Gulf Sep 11th Attacks Tonkin Gulf Reichstag “//f2f:list” Nodes whose children are sorted Semicolon-separated list of sort “1”Semicolon-separated list of is also available to specify sort(s) on ‘number’ or ‘text’.

` Example - reversing Node Order *-sort-keys may use any xpath. For example, to reverse child order: pre, mid, post //false-flags.xml Reichstag Fire Sep 11th Attacks Tonkin “//f2f:list” <!-- False Fag operations → Tonkin Gulf Sep 11th Attacks Reichstag Fire

@this-insert-* : Adding Input Branches This selects branches of input XML and appends it to the output. mid ` Reichstag Fire Sep 11th Attacks Tonkin Gulf //false-flags.xml 139 Reichstag Fire Sep 11th Attacks is analagous to the Unix “//f2f:list”

@this-insert-* : Calculating XPaths If this evaluates to a string, it is added to the output in the same way. mid ` Reichstag Fire Sep 11th Attacks Tonkin Gulf //false-flags.xml bytes, 3 item(s). If the Xpath result is a shallow are identical. If a node set, only the former keeps child “concat(‘ bytes,’, count(//f2f:item),’ item(s).’)”

@pre-test : Conditional Interpretation This directive is evaluated on the input document, and stops processing iff it evaluates to an empty node set, empty string, ‘false’ or ‘0’. pre‏ “//f2f:item” If processing is is applied to the is barely used as yet, and may still be subject to change, such as throwing an exception on failure. = empty node set, so no processing

@ * -update : Modifying node values/names This attribute is an Xpath to specify nodes to modify. pre, mid, post The changes are processed in document order, important if the nodes refer to one another. e.g, A hierarchy of folders can be converted into a hierarchy of paths by using Attributes The modification is described by one or more of the Xpaths below, which are evaluated with respect to the @*-update-value New nameNew namespaceNew value Comments ignored New value CData ignored New value Elements New nameNew namespaceNew value P. I.’s New nameignoredNew value

@ * -validate : Validating Input/Output This regulates validation of particular calls. The value is either “*” (=no validation) or a URI of a service available on the soft-system. pre, mid, post ` are used internally if automatic validation is enabled. To suppress automatic input/midput/output validation of services, set the appropriate attribute= “*” in the module definition file. The only valid value of pre-validate which suppresses input validation. This may be helpful if input validation is undesirably strict (such as for the bag-read service, which requires numerical ids.

@ * -xml-space : Preserving Whitespace This adds an xml:space attribute to the top of the output: mid, post <!-- Transform here, which gets the width. --!> <!-- Transform here, which gets the height. --!> ` is for handling whitespace sensitive files (discouraged in “1”

//bad-servicereqs.xml //bad-servicereqs(copy).xml Safe Processing of Untrusted XML A common task is to handle any XML, without interpreting any servicereqs. adds f2f:escaped=”*” at the root element(s) so the contents will not be “/*”

Safe Processing of Unknown XML - 2 The f2f:file has f2f:escaped=“*”, so now the outer request is processed: Won’t be interpreted because of the above. ::sink.xml removes the escaping item before it is “f2f:data/f2f:file” //bad-servicereqs(copy).xml This request writes the data from the file without having processed its contents. //bad-servicereqs(copy).xml

Summary Recommended Follow-up: FF7: Server Structure Their efficiency and brevity means they should be used in preference to They modify the servicereq processing model and perform XML manipulations. Processing-directives are of 3 types, according to the order of evaluation. pre mid post