Docsity

Transduction - Principles of Software Development - Lecture Notes, Study notes of Software Engineering

Toggle sidebar
bg1
SOA: Service-Oriented Architecture: the
practice of composing programs from
services.
SOAP: Simple Object Access Protocol: how
services are built.
WSDL: Web Services Definition Language:
describes how to build service clients.
WSAPI: Web Services Application
Programming Interface: describes how to
advertise services for search and
discovery.
Recall from last time:
Recall from last time
Wednesday, November 28, 2012
12:14 PM
Transduction Page 1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Transduction - Principles of Software Development - Lecture Notes and more Study notes Software Engineering in PDF only on Docsity!

SOA: Service-Oriented Architecture: the practice of composing programs from services. SOAP: Simple Object Access Protocol: how services are built. WSDL: Web Services Definition Language: describes how to build service clients. WSAPI: Web Services Application Programming Interface: describes how to advertise services for search and discovery. Recall from last time: Recall from last time Wednesday, November 28, 2012 12:14 PM Docsity.com

Global picture Monday, November 26, 2012 5:47 PM Docsity.com

Advertise services (via WSAPI) in a "service marketplace" Clients "subscribe" to services (for a fee). Another word for subscription: "binding". A client can change its mind about bindings: "on Tue, use google maps; on Thu, use MapQuest." A dream that never happened Many services are very simple software front-ends to complex and difficult-to- maintain data repositories. Data maintenance costs money. Therefore, data access should cost money. The service source code is irrelevant; it does nothing without the corpora. Logic behind the dream Theoretically: set by ISP. In practice: set by location-aware service provider. Location-aware services: map IP to Lat, Long. Theoretically: user-provided. Mapping services: translate Lat, Long to features at that Lat, Long Examples: A dream that never happened Wednesday, November 28, 2012 12:20 PM Docsity.com

Theoretically: user-provided. In practice: require substantive editing. Already a cost-based service. Reverse phone lookup: address from phone number Docsity.com

Consider the following two services: Input: Latitude, Longitude Output: IPAddress

A:

Input: Lat, Long Output: IP

B:

Are these the same service? How does one translate between them? This is a problem of ontology and synonyms: when do two variable names mean the same thing? The problem of ontology Wednesday, November 28, 2012 12:13 PM Docsity.com

A problem of semantics Input: Lat, Long (in a spherical datum, e.g., a satellite grid) Output: feature set, e.g., businesses located here

A:

Input: Lat, Long (in a spheroidal datum, e.g., GPS) Output: feature set, e.g., businesses located here

B:

Two services: The parameter names are the same: no problem of ontology and/or synonyms. The semantics of the parameters are different. (The same pair of numbers means a different location on the earth!) A problem of semantics Wednesday, November 28, 2012 12:30 PM Docsity.com

A language specifically for transforming one XML document into another. Programs are "stylesheets" that look like eXtensible Stylesheet Language (XSL).

XSLT

XSL XSLT

Output is HTML Output is XML Run in browser/client Run on server Purport: typesetting Purport: adaptation Comparison XSLT Wednesday, November 28, 2012 1:04 PM Docsity.com

The Underground City Jules Verne June 1988 Project Gutenberg

The Goal of Project Gutenberg is to Give Away One Trillion Etext Files by the December 31, 2001. [10,000 x 100,000,000=Trillion] This is ten thousand titles each to one hundred million readers, which is only 10% of the present number of computer users. 2001 should have at least twice as many computer users as that, so it will require us reaching less than 5% of the users in 2001.

We need your donations more than ever! For these and other matters, please mail to:

Project Gutenberg P. O. Box 2782 Champaign IL 61825

The line

indicates that this is an XML document.

The line:

says to format this according to an external stylesheet gut.xsl.

An XML input file: An XML input file Wednesday, November 28, 2012 1:06 PM Docsity.com

The result of this formatting is equivalent to the following HTML:

The Underground City

The Underground City

Author: Jules Verne Date: June 1988 Publisher: Project Gutenberg

Preface

The Goal of Project Gutenberg is to Give Away One Trillion Etext Files by the December 31, 2001. [10,000 x 100,000,000=Trillion] This is ten thousand titles each to one hundred million readers, which is only 10% of the present number of computer users. 2001 should have at least twice as many computer users as that, so it will require us reaching less than 5% of the users in 2001.

We need your donations more than ever! For these and other matters, please mail to:

Project Gutenberg P. O. Box 2782 Champaign, IL, 61825

Wednesday, November 28, 2012 1:32 PM Docsity.com

Docsity.com

  • Let's go through the XSL file and try to understand its parts. The line:

    says that this is an XML document (like gut.xml) (The extra encoding describes the file's character set, and is optional).

  • The line:

    begins a stylesheet. The specifications after the xml:stylesheet identify the form of the document to follow by referring to specific standards. These are required. ○ xsl:text delimits literal text to embed in the final document. xsl:template describes what to do in a document when you encounter a specific XML tag. ○ xsl:value-of allows you to intersperse the text value inside a specific XML tag directly into the results. ○ xsl:apply-templates is a special tag that tells the XSL processor to recurse. This causes the content of the tag being matched to be parsed and matched against templates itself. ○

  • Within the stylesheet, four directives do most of the work: Deconstructing XSL Wednesday, November 28, 2012 1:29 PM Docsity.com

An XSL transformation is processed in a very simple fashion.

First we form the document tree for the source XML document.

Then we do a recursive tree walk through the document tree, from top to bottom and left to right, checking for matches with templates as we go.

When a template matches a tag in the document tree, we replace the tag it matches (and its content) with the content of the template.

When a tag doesn't match a template, we include its literal content.

The result is an HTML document based upon the original XML.

XSL processing Wednesday, November 28, 2012 1:29 PM Docsity.com

  • declares an action to take when a tag is matched. match="tag" describes the tag to match. match="document" matches all tags in the source document that are nameddocument.

the content of the xsl:template tag replaces the content of the matched tag, wherever it appears in the source document.

directive causes processing of tags in the content of the matched tag. By default, these tags are not processed.

xsl:template Wednesday, November 28, 2012 1:27 PM Docsity.com

It is often handy to be able to insert text from another part of the XML document into a specific place.

  • The xsl:value-of directive causes the text content of a specified tag to be inserted at a particular position within the document. Tag subcontent is ignored.

  • The select attribute is a pattern match just like the one for xsl:template. By default, pattern matches are relative to the current tag. For example, if we have the document:

  • Marcy black Joe calico

    and we are inside , then is replaced with the content of the name tag for the feline in question. Let's make a table of all the felines:

<xsl:text>Cats I know</xsl:text> Cats I know

Name Color

xsl:value-of Wednesday, November 28, 2012 1:26 PM Docsity.com