Content adaption. Johan Montelius

Size: px
Start display at page:

Download "Content adaption. Johan Montelius"

Transcription

1 Content adaption Johan Montelius Introduction In this laboration you will do some server side scripting to identify a terminal and to adapt content to its characteristcs. We will use the follwong technology: PHP for server side scripting, XML for representing content XSL for tranforming content to presentation UAprof for extracting information about the terminal Getting started Since we shall explore some server side scripting you need a web server to upload your documents to. If you access your documents directly over the file system the scripts will not be executed. I will assume that you use the or web server and that the choice of scripting language is PHP. If you re using another server you need to check which scripting languages that are supported and choose one of them. The examples in this tutorial will be different for different languages but the idea is the same. 1 Your first script PHP scripts are written inline in any document that the server is configures to scan for scripts. Documents with a.html or.php extension are scanned per default but.wml documents are normally not scanned. The reason is that the sequence <?... is used to identify the beginning of a script and this is of course in conflict with the XML declaration in a WML document. To work with PHP and WML we need to do a little trick. We use the.php extension but give directives to the web server to present the document as a WML document. Write the following code in a filetest.php and upload it to the server. <script language="php"> header( Content-type: text/vnd.wap.wml ); echo <?xml version="1.0"?> 1

2 <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" " ; <wml> <card title= PHP Test > <p>a small test.</p> </wml> The PHP script is enclosed by the <script language= php > and tags. The first line of the script is a directive to the web server to serve the document as a WML document so a browser will accept it and handle it properly even though it has the.php extension. The second statement will output the XML header. We need to produce this in the script since we could not write it directly. Notice that the final document is all text in the source document apart from the script sections but including anything the scripts output using echo or print statements. Access the file test.php from a phone or WML browser and make sure that no traces of the PHP script remains. 2 Knock, knock. - Who is there The PHP script engine running on the server and has direct access to the HTTP get (or POST) request. The information in the request headers is made available to the scripts in the form of entries in a key-word indexed array. One way to find out what information we can work with is to write a script that displays the content of the array. Try the following script in a document called http.php. Don t forget the PHP intro that will generate the XML header. <wml> <card id="home" title="http info"> <p>this is an example of HTTP variables that you can access using PHP.</p> <p> <a href="#server">server</a> <br/> </p> <card id="server" title="http info"> <p><b>server</b></p> <script language="php"> reset($_server); 2

3 while (list($key, $val) = each($_server) ) { echo "<p>key: ".$key. " <br/>"; echo " Val: <![CDATA[".$val. " ]]></p>"; </wml> If you access the document with a browser (try several) you will find that they produce quite different information. Some of the information pertains to the web server but some depend on the browser. Pay especially attention to the HTTP ACCEPT and HTTP USER AGENT keys. Why did I use the construct with <![CDATA[...]]>, why not simply echo the $val value? If we access the HTTP USER AGENT directly we can write the following page (I know, I m getting sloppy). <wml> <card id="home" title="i Spy"> <p>hello, I see that you re using a <?php echo $_SERVER[ HTTP_USER_AGENT ];?>!</p> </wml> As you know it is very tricky to use the user-agent string to adapt the content so let s move on to the accept header. 3 WML/HTML Let s create a site that returns WML or HTML documents depending on the capabilities of the client browser. The accept header is however not as simple to parse as might seam at first sight. Notice that you (probably) have some q=0.9 or similar directives in the sequence. These parameters are quality factors and specify if a media type is more (1.0) or less (0.0) preferred. If nothing is mentioned the quality factor by default 1.0. Take a look in RFC-2616 for a complete description of the accept header. Let s make a simple page that returns a WML page if WML is an accepted media type and a HTML page otherwise. We use the library function strpos() to detect if the accept header contains the string text/vnd.wap.wml and then produce two different versions of the page. Not that since 0 could also be interpreted as false we need to be very careful when we check the result of the strpos() call; === is equal without type conversion. 3

4 <script language= php > $accept = $_SERVER[ HTTP_ACCEPT ]; /* $pos will be either false or the position of the string */ $pos = strpos($accept, text/vnd.wap.wml ); /* $wml will be true if the string was found */ $wml = ($pos === 0 $pos > 0 ); if( $wml ) { header( Content-type: text/vnd.wap.wml ); echo <?xml version="1.0"?> ; echo <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" " ; echo <wml> <card title="dynamic"> <p>ahh, a WML surfer!</p> </wml> ; else { header( Content-type: text/html ); echo <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ; echo <html> <head> <title>dynamic</title> </head> <body> <p>ahh, an HTML surfer!</p> </nody> </html> ; We could also look for support for XHTML and look for quality factors and serve the content that is most wanted. Since some browses (WAP 2.0) can handle both XHTML and WML we would have a choice. We could also direct the client to the right document using a redirect directive. This would however no be the best solution since this would require a mobile client to perform a second HTTP get request. One alternative would then be to serve a WML page with wml-links or a XHTML page with html-links. 4

5 4 A bit of XML parsing In the quest to separate content from presentation we will do a bit of XML hacking. Let s assume that we have a file with the latest news in the following format: <?xml version="1.0"?> <news> <story id="n1"> <date>2004/08/20</date> <title>this is news</title> <short>this is a short description of the news. We will keep int short in order to deliver it to smaller devices. </short> <long> <pre>a short intro before the whole text</pre> <full>this is the full story. It could be long and include all the details that could not fit into the short description. I don t want to write it all now.</full> </long> </story> <story id="n2"> <date>2004/08/21</date> <title>even more news</title> <short>the short description of the news is now shorter.</short> <long> <pre>a small intro</pre> <full>and the the full story. It could be long and include all the details that could not fit into the short description. </full> </long> </story> </news> The quest is now to serve this content to smaller devices using WML and larger devices using XHTML. We need to do the same trick as before to discover the capabilities of the device but we also need to transform the above news descriptions into WML and XHTML. Let s first create a page, news-wml.php that delivers the WML version. To help us in this process we use a XML parser accessible from PHP. The parser is a generic parser that runs through a XML document and by default does nothing. We need to create a element handler and a character handler to produce anything. The handlers are called every time the parser enter or leaves an element or when a character data section is encountered. 5

6 Look at the function startelement below, it is called when we enter an element. If the name of the element is SHORT or TITLE we should do something. If we enter the short element we set the global variable $chardata to true and write a <p> tag to the output stream. The $chardata variable will be a signal to the character data function to output the character data field. <script language="php"> header( Content-type: text/vnd.wap.wml ); echo <?xml version="1.0"?> ; echo <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" " ; <wml> <card> <script language="php"> $chardata = FALSE; function startelement($parser, $name, $attrs) { if( strcmp($name,"short") == 0 ) { global $chardata; $chardata = TRUE; echo "<p>"; elseif (strcmp($name,"title") == 0 ) { global $chardata; $chardata = TRUE; echo "<p>"; function endelement($parser, $name) { if( strcmp($name,"short") == 0 ) { global $chardata; $chardata = FALSE; echo "</p>"; elseif (strcmp($name,"title") == 0 ) { global $chardata; $chardata = FALSE; echo "</p><br/>"; 6

7 function characterdata($parser, $data) { global $chardata; if($chardata) { echo $data; /* create the parser */ $xml_parser = xml_parser_create(); /* we want all our tags to be upper case */ xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true); /* now we add an element handler */ xml_set_element_handler($xml_parser, "startelement", "endelement"); /* and a character handler */ xml_set_character_data_handler($xml_parser, "characterdata"); /* access the name of the news file */ $file = "news.xml"; /* open the file */ if (!($fp = fopen($file, "r"))) { die("could not open XML input"); /* start reading and feeding the parser */ while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("xml error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); xml_parser_free($xml_parser); </wml> Go through the setting up of the parser and try to output WML content in another way, maybe including the date. Then create a file news-html.php that produces the XHTML version. 7

8 5 XSL Transformations The above transformations can be automated by using XSL transformation. You need a webserver with PHP and XSLT support. If you re going to work on another web server than web.it.kth.se you must make sure that the Sablotron package is loaded. You can always check wich packages that are supported by writing a smal php-page with the call phpinfo(). It is also very usefull to havexsltproc installed on your local machine to run XSL transformations locally. You can find documentation on xsltproc on you can install it under Cygwin if you re using Windows. We start by using the news data file, news.xml. Now we create a XSL document with some directives on how to transform the news. We first creat a file, news-wml.xsl that will output the news in WML-format. <?xml version="1.0" encoding="iso "?> <xsl:stylesheet version="1.0" xmlns:xsl=" <xsl:output method="html" encoding="iso " doctype-public="-//wapforum//dtd WML 1.1//EN" doctype-system=" <xsl:template match="/"> <wml> <card> <p> <table columns="1"> <xsl:for-each select="news/story"> <tr> <td> <a> <xsl:attribute name="href"> #<xsl:value-of select="@id"/> </xsl:attribute> <xsl:value-of select="title"/> </a> </td> </tr> </xsl:for-each> </table> </p> 8

9 <xsl:for-each select="news/story"> <card> <xsl:attribute name="id"> <xsl:value-of </xsl:attribute> <p><xsl:value-of select="title"/><br/> <xsl:value-of select="short"/> </p> </xsl:for-each> </wml> </xsl:template> </xsl:stylesheet> Now this is of course a lot of XSL in one go but if you go through the code you will get the main idea of how it works. The next thing we need is a script file that calls the xslt process and apply the xsl transformation on the news.xml file. <script language="php"> $file = "news.xml"; $xsl = "news-wml.xsl"; $xh = xslt_create(); $result = xslt_process($xh, $file, $xsl); header( Content-type: text/vnd.wap.wml ); if ($result) { print $result; else { print "Error"; xslt_free($xh); Now write a news-html.xsl file that transforms the news into XHTML. You also need a news-xsl.-html.php file but as you can see this is a trivial modification. Using the two XSL transformations and the examples above where we looked at the accept headers you can easily write a news-xsl.php file that calls the right xsl file depending on the accept header. 9

10 6 UAProf The most interesting test is of course if we can take the UAprof from the request header and transform it into a XSL file that can be used to transform our news file. We will only do as simple transformation to see that we can actually retrieve the UAProf and parse it. It becomes quite comlicated if we want to do more advanced transformations. We first need a new directory called cache that should be writeable (and insert) by the webserver. YOu need to set the AFS rights to fix this. We will store uaprofs and also device XSl files in this directory. We then need a file uaprox.xsl that will take a UAprof file and turn it into a WML file. We will onlt produce WML files given the news.xml files that we have but we will augmnent it with a greeting thatis unique for each terminal. You will find this file on the course web site. Next we need a uaprof.php file that reads the UAProf (if available), caches it and process it using uaprof.xsl. The result is saved as model.xsl (where model is the name of the terminal, in the cache. This XSL file is then used to process the news.xml file. Tricky, yes ideed. Set it up and test it with a phone, then try other models and see how you start to collect UAprof data. For a more advanced exercise you can try to extract information about screen size and serve each device a banner that fits the screen. 10

Processing XML using PHP

Processing XML using PHP Processing XML using PHP Barry Cornelius Computing Services, University of Oxford Date: 8th November 2002; first created 4th November 2002 http://users.ox.ac.uk/~barry/papers/ mailto:barry.cornelius@oucs.ox.ac.uk

More information

but XML goes far beyond HTML: it describes data

but XML goes far beyond HTML: it describes data The XML Meta-Language 1 Introduction to XML The father of markup languages: XML = EXtensible Markup Language is a simplified version of SGML Originally created to overcome the limitations of HTML the HTML

More information

XSLT (part I) Mario Alviano A.Y. 2017/2018. University of Calabria, Italy 1 / 22

XSLT (part I) Mario Alviano A.Y. 2017/2018. University of Calabria, Italy 1 / 22 1 / 22 XSLT (part I) Mario Alviano University of Calabria, Italy A.Y. 2017/2018 Outline 2 / 22 1 Introduction 2 Templates 3 Attributes 4 Copy of elements 5 Exercises 4 / 22 What is XSLT? XSLT is a (Turing

More information

XML: Tools and Extensions

XML: Tools and Extensions XML: Tools and Extensions Web Programming Uta Priss ZELL, Ostfalia University 2013 Web Programming XML2 Slide 1/20 Outline XML Parsers DOM SAX Data binding Web Programming XML2 Slide 2/20 Tree-based parser

More information

XML: Tools and Extensions

XML: Tools and Extensions XML: Tools and Extensions SET09103 Advanced Web Technologies School of Computing Napier University, Edinburgh, UK Module Leader: Uta Priss 2008 Copyright Napier University XML2 Slide 1/20 Outline XML Parsers

More information

XML. Objectives. Duration. Audience. Pre-Requisites

XML. Objectives. Duration. Audience. Pre-Requisites XML XML - extensible Markup Language is a family of standardized data formats. XML is used for data transmission and storage. Common applications of XML include business to business transactions, web services

More information

XML Applications. Prof. Andrea Omicini DEIS, Ingegneria Due Alma Mater Studiorum, Università di Bologna a Cesena

XML Applications. Prof. Andrea Omicini DEIS, Ingegneria Due Alma Mater Studiorum, Università di Bologna a Cesena XML Applications Prof. Andrea Omicini DEIS, Ingegneria Due Alma Mater Studiorum, Università di Bologna a Cesena Outline XHTML XML Schema XSL & XSLT Other XML Applications 2 XHTML HTML vs. XML HTML Presentation

More information

Excel to XML v3. Compatibility Switch 13 update 1 and higher. Windows or Mac OSX.

Excel to XML v3. Compatibility Switch 13 update 1 and higher. Windows or Mac OSX. App documentation Page 1/5 Excel to XML v3 Description Excel to XML will let you submit an Excel file in the format.xlsx to a Switch flow where it will be converted to XML and/or metadata sets. It will

More information

XSL Languages. Adding styles to HTML elements are simple. Telling a browser to display an element in a special font or color, is easy with CSS.

XSL Languages. Adding styles to HTML elements are simple. Telling a browser to display an element in a special font or color, is easy with CSS. XSL Languages It started with XSL and ended up with XSLT, XPath, and XSL-FO. It Started with XSL XSL stands for EXtensible Stylesheet Language. The World Wide Web Consortium (W3C) started to develop XSL

More information

Computer Science E-259

Computer Science E-259 Computer Science E-259 XML with Java Lecture 4: XPath 1.0 (and 2.0) and XSLT 1.0 (and 2.0) 21 February 2007 David J. Malan malan@post.harvard.edu 1 Computer Science E-259 Last Time DOM Level 3 JAXP 1.3

More information

Shankersinh Vaghela Bapu Institue of Technology

Shankersinh Vaghela Bapu Institue of Technology Branch: - 6th Sem IT Year/Sem : - 3rd /2014 Subject & Subject Code : Faculty Name : - Nitin Padariya Pre Upload Date: 31/12/2013 Submission Date: 9/1/2014 [1] Explain the need of web server and web browser

More information

Style Sheet A. Bellaachia Page: 22

Style Sheet A. Bellaachia Page: 22 Style Sheet How to render the content of an XML document on a page? Two mechanisms: CSS: Cascading Style Sheets XSL (the extensible Style sheet Language) CSS Definitions: CSS: Cascading Style Sheets Simple

More information

Excel to XML v4. Version adds two Private Data sets

Excel to XML v4. Version adds two Private Data sets Excel to XML v4 Page 1/6 Excel to XML v4 Description Excel to XML will let you submit an Excel file in the format.xlsx to a Switch flow were it will be converted to XML and/or metadata sets. It will accept

More information

XML and XSLT. XML and XSLT 10 February

XML and XSLT. XML and XSLT 10 February XML and XSLT XML (Extensible Markup Language) has the following features. Not used to generate layout but to describe data. Uses tags to describe different items just as HTML, No predefined tags, just

More information

Exam : Title : XML 1.1 and Related Technologies. Version : DEMO

Exam : Title : XML 1.1 and Related Technologies. Version : DEMO Exam : 000-142 Title : XML 1.1 and Related Technologies Version : DEMO 1. XML data is stored and retrieved within a relational database for a data-centric application by means of mapping XML schema elements

More information

The main Topics in this lecture are:

The main Topics in this lecture are: Lecture 15: Working with Extensible Markup Language (XML) The main Topics in this lecture are: - Brief introduction to XML - Some advantages of XML - XML Structure: elements, attributes, entities - What

More information

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013 Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013 2 Outline Introduction XML Structure Document Type Definition (DTD) XHMTL Formatting XML CSS Formatting XSLT Transformations

More information

Web Programming Paper Solution (Chapter wise)

Web Programming Paper Solution (Chapter wise) What is valid XML document? Design an XML document for address book If in XML document All tags are properly closed All tags are properly nested They have a single root element XML document forms XML tree

More information

XSLT: How Do We Use It?

XSLT: How Do We Use It? XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman 1 XSLT: Agenda Introduction & Terminology XSLT Walkthrough Client-Side XSLT/XHTML Server-Side XSLT/XHTML More Creative Server-Side XSLT 2 XSLT:

More information

Advanced Studies in IT CT433 Exam Q&A

Advanced Studies in IT CT433 Exam Q&A Advanced Studies in IT CT433 Exam Q&A Dr. Axel Polleres www.deri.ie Copyright 2008 Digital Enterprise Research Institute. All rights reserved. XML Know what is well-formed XML, valid XML Well-formed: Close

More information

Course Content. Outline of Lecture 12. Objectives of Lecture 12 SGML to XML. CMPUT 410: SGML to XML. Dr. Osmar R. Zaïane. University of Alberta 4

Course Content. Outline of Lecture 12. Objectives of Lecture 12 SGML to XML. CMPUT 410: SGML to XML. Dr. Osmar R. Zaïane. University of Alberta 4 Web-Based Information Systems Fall 2007 CMPUT 410: SGML to XML Dr. Osmar R. Zaïane Course Content Introduction Internet and WWW Protocols HTML and beyond Animation & WWW CGI & HTML Forms Dynamic Pages

More information

Introduction to HTML5

Introduction to HTML5 Introduction to HTML5 History of HTML 1991 HTML first published 1995 1997 1999 2000 HTML 2.0 HTML 3.2 HTML 4.01 XHTML 1.0 After HTML 4.01 was released, focus shifted to XHTML and its stricter standards.

More information

HWg-STE: Portal implementation manual version 4.8.1

HWg-STE: Portal implementation manual version 4.8.1 HWg-STE: Portal implementation manual version 4.8.1 Push HWg-STE firmware you can download from: http://new.hwg.cz/en/hwg-ste-portal HWg-PDMS: Portal supported from version 1.4.6 1 / 18 (1) Connect & power-on

More information

Generating Web Pages Using XSLT

Generating Web Pages Using XSLT Generating Web Pages Using XSLT 238 XSLT for Data Interchange 239 6.1.xml: An Employee List Document

More information

Structured documents

Structured documents Structured documents An overview of XML Structured documents Michael Houghton 15/11/2000 Unstructured documents Broadly speaking, text and multimedia document formats can be structured or unstructured.

More information

HTML 5 Form Processing

HTML 5 Form Processing HTML 5 Form Processing In this session we will explore the way that data is passed from an HTML 5 form to a form processor and back again. We are going to start by looking at the functionality of part

More information

:38:00 1 / 14

:38:00 1 / 14 In this course you will be using XML Editor version 12.3 (oxygen for short from now on) for XML related work. The work includes writing XML Schema files with corresponding XML files, writing

More information

XML. Presented by : Guerreiro João Thanh Truong Cong

XML. Presented by : Guerreiro João Thanh Truong Cong XML Presented by : Guerreiro João Thanh Truong Cong XML : Definitions XML = Extensible Markup Language. Other Markup Language : HTML. XML HTML XML describes a Markup Language. XML is a Meta-Language. Users

More information

extensible Markup Language (XML) Basic Concepts

extensible Markup Language (XML) Basic Concepts (XML) Basic Concepts Giuseppe Della Penna Università degli Studi di L Aquila dellapenna@univaq.it http://www.di.univaq.it/gdellape This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike

More information

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT. Chapter 7:- PHP Compiled By:- Assistant Professor, SVBIT. Outline Starting to script on server side, Arrays, Function and forms, Advance PHP Databases:-Basic command with PHP examples, Connection to server,

More information

Course Topics. IT360: Applied Database Systems. Introduction to PHP

Course Topics. IT360: Applied Database Systems. Introduction to PHP IT360: Applied Database Systems Introduction to PHP Chapter 1 and Chapter 6 in "PHP and MySQL Web Development" Course Topics Relational model SQL Database design Normalization PHP MySQL Database administration

More information

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP Course Topics IT360: Applied Database Systems Introduction to PHP Database design Relational model SQL Normalization PHP MySQL Database administration Transaction Processing Data Storage and Indexing The

More information

Lecture 2: Tools & Concepts

Lecture 2: Tools & Concepts Lecture 2: Tools & Concepts CMPSCI120 Editors WIN NotePad++ Mac Textwrangler 1 Secure Login Go WIN SecureCRT, PUTTY WinSCP Mac Terminal SFTP WIN WinSCP Mac Fugu 2 Intro to unix pipes & filters file system

More information

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University Markup Languages SGML, HTML, XML, XHTML CS 431 February 13, 2006 Carl Lagoze Cornell University Problem Richness of text Elements: letters, numbers, symbols, case Structure: words, sentences, paragraphs,

More information

Author: Irena Holubová Lecturer: Martin Svoboda

Author: Irena Holubová Lecturer: Martin Svoboda NPRG036 XML Technologies Lecture 6 XSLT 9. 4. 2018 Author: Irena Holubová Lecturer: Martin Svoboda http://www.ksi.mff.cuni.cz/~svoboda/courses/172-nprg036/ Lecture Outline XSLT Principles Templates Instructions

More information

Generating Variants Using XSLT Tutorial

Generating Variants Using XSLT Tutorial Table of Contents 1. Overview... 1 2. About this tutorial... 1 3. Setting up the pure::variants project... 1 4. Setting up the feature model... 3 5. Setting up the family model... 4 6. Setting up the XSLT

More information

Use of RSS feeds for Content Adaptation in Mobile Web Browsing

Use of RSS feeds for Content Adaptation in Mobile Web Browsing Use of RSS feeds for Content Adaptation in Mobile Web Browsing Alexander Blekas University of Patras Computer Engineering & Informatics Department Computer Technology Institute +306932321212 mplekas@ceid.upatras.gr

More information

Using Java servlets to generate dynamic WAP content

Using Java servlets to generate dynamic WAP content C H A P T E R 2 4 Using Java servlets to generate dynamic WAP content 24.1 Generating dynamic WAP content 380 24.2 The role of the servlet 381 24.3 Generating output to WAP clients 382 24.4 Invoking a

More information

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 WEB TECHNOLOGIES A COMPUTER SCIENCE PERSPECTIVE CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 Modified by Ahmed Sallam Based on original slides by Jeffrey C. Jackson reserved. 0-13-185603-0 HTML HELLO WORLD! Document

More information

A Guide for Designing Your Own Dyamic SiteMason Templates. Creating. SiteMason Templates

A Guide for Designing Your Own Dyamic SiteMason Templates. Creating. SiteMason Templates A Guide for Designing Your Own Dyamic SiteMason Templates Creating SiteMason Templates 2 Creating SiteMason Templates (c) 2003 Monster Labs, Inc. Current Version: February 6, 2003 Manual Version 1.0 3

More information

Introduction to XSLT. Version 1.0 July nikos dimitrakas

Introduction to XSLT. Version 1.0 July nikos dimitrakas Introduction to XSLT Version 1.0 July 2011 nikos dimitrakas Table of contents 1 INTRODUCTION... 3 1.1 XSLT... 3 1.2 PREREQUISITES... 3 1.3 STRUCTURE... 3 2 SAMPLE DATA... 4 3 XSLT... 6 4 EXAMPLES... 7

More information

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name EXAM IN SEMI-STRUCTURED DATA 184.705 10. 01. 2017 Study Code Student Id Family Name First Name Working time: 100 minutes. Exercises have to be solved on this exam sheet; Additional slips of paper will

More information

Automated tools for supporting CC design evidence. September 2008

Automated tools for supporting CC design evidence. September 2008 Automated tools for supporting CC design evidence September 2008 Outline 01_ Introduction 02_ Automated tools adapted to developers 02_ 1 applicable to Security Target 02_ 2 applicable to evidence of Development

More information

Hypermedia and the Web XSLT and XPath

Hypermedia and the Web XSLT and XPath Hypermedia and the Web XSLT and XPath XSLT Extensible Stylesheet Language for Transformations Compare/contrast with CSS: CSS is used to change display characteristics of primarily HTML documents. But,

More information

Semantic Web. XSLT: XML Transformation. Morteza Amini. Sharif University of Technology Fall 95-96

Semantic Web. XSLT: XML Transformation. Morteza Amini. Sharif University of Technology Fall 95-96 ه عا ی Semantic Web XSLT: XML Transformation Morteza Amini Sharif University of Technology Fall 95-96 Outline Fundamentals of XSLT XPath extensible Stylesheet Language Cocoon 2 XSLT XSLT stands for extensible

More information

Extensible Markup Stylesheet Transformation (XSLT)

Extensible Markup Stylesheet Transformation (XSLT) Extensible Markup Stylesheet Transformation (XSLT) Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Overview Terms: XSL, XSLT, XSL-FO Value

More information

XSL Concepts: Conditions and Loops. Robert Kiffe, Senior Web Developer OmniUpdate, Inc.

XSL Concepts: Conditions and Loops. Robert Kiffe, Senior Web Developer OmniUpdate, Inc. XSL Concepts: Conditions and Loops Robert Kiffe, Senior Web Developer OmniUpdate, Inc. Quick XSL Recap Conditional Statements If Choose XPath Conditional Loops For-Each For-Each-Group Apply-Templates Activities!

More information

XML for Java Developers G Session 2 - Sub-Topic 1 Beginning XML. Dr. Jean-Claude Franchitti

XML for Java Developers G Session 2 - Sub-Topic 1 Beginning XML. Dr. Jean-Claude Franchitti XML for Java Developers G22.3033-002 Session 2 - Sub-Topic 1 Beginning XML Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Objectives

More information

XML Overview, part 1

XML Overview, part 1 XML Overview, part 1 Norman Gray Revision 1.4, 2002/10/30 XML Overview, part 1 p.1/28 Contents The who, what and why XML Syntax Programming with XML Other topics The future http://www.astro.gla.ac.uk/users/norman/docs/

More information

Birkbeck (University of London)

Birkbeck (University of London) Birkbeck (University of London) MSc Examination Department of Computer Science and Information Systems Internet and Web Technologies (COIY063H7) 15 Credits Date of Examination: 13 June 2017 Duration of

More information

INTERNET & WEB APPLICATION DEVELOPMENT SWE 444. Fall Semester (081) Module 4 (III): XSL

INTERNET & WEB APPLICATION DEVELOPMENT SWE 444. Fall Semester (081) Module 4 (III): XSL INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module 4 (III): XSL Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals alfy@kfupm.edu.sa

More information

CS134 Web Site Design & Development. Quiz1

CS134 Web Site Design & Development. Quiz1 CS134 Web Site Design & Development Quiz1 Name: Score: Email: I Multiple Choice Questions (2 points each, total 20 points) 1. Which of the following is an example of an IP address? a. www.whitehouse.gov

More information

XSL extensible Style Language" DOCUMENTS MULTIMEDIA! Transforming documents using! XSLT" XSLT processor" XSLT stylesheet"

XSL extensible Style Language DOCUMENTS MULTIMEDIA! Transforming documents using! XSLT XSLT processor XSLT stylesheet DOCUMENTS MULTIMEDIA! Transforming documents using! XSLT" XSL extensible Style Language"!" A family of languages for defining document transformation and presentation" XSL XSLT XSL-FO Christine Vanoirbeek"

More information

Databases PHP I. (GF Royle, N Spadaccini ) PHP I 1 / 24

Databases PHP I. (GF Royle, N Spadaccini ) PHP I 1 / 24 Databases PHP I (GF Royle, N Spadaccini 2006-2010) PHP I 1 / 24 This lecture This covers the (absolute) basics of PHP and how to connect to a database using MDB2. (GF Royle, N Spadaccini 2006-2010) PHP

More information

Alpha College of Engineering and Technology. Question Bank

Alpha College of Engineering and Technology. Question Bank Alpha College of Engineering and Technology Department of Information Technology and Computer Engineering Chapter 1 WEB Technology (2160708) Question Bank 1. Give the full name of the following acronyms.

More information

XML and Databases. Lecture 11 XSLT Stylesheets and Transforms. Sebastian Maneth NICTA and UNSW

XML and Databases. Lecture 11 XSLT Stylesheets and Transforms. Sebastian Maneth NICTA and UNSW XML and Databases Lecture 11 XSLT Stylesheets and Transforms Sebastian Maneth NICTA and UNSW CSE@UNSW -- Semester 1, 2010 Outline 1. extensible Stylesheet Language Transformations (XSLT) 2. Templates:

More information

<?xml version = 1.0 encoding= windows-874?> <?xml-stylesheet type= text/css href= #xmldocs?> <style id= xmldocs > element-name{ } </style>

<?xml version = 1.0 encoding= windows-874?> <?xml-stylesheet type= text/css href= #xmldocs?> <style id= xmldocs > element-name{ } </style> XML Displaying Displaying XML: CSS A modern web browser and a cascading style sheet (CSS) may be used to view XML as if it were HTML A style must be defined for every XML tag, or the browser displays it

More information

DISCIPLINE SPECIFIC 4: WIRELESS APPLICATION PROTOCOL Semester : VI Course Code : 16UCS504 Syllabus UNIT II: The Wireless Markup Language: Overview

DISCIPLINE SPECIFIC 4: WIRELESS APPLICATION PROTOCOL Semester : VI Course Code : 16UCS504 Syllabus UNIT II: The Wireless Markup Language: Overview DISCIPLINE SPECIFIC 4: WIRELESS APPLICATION PROTOCOL Semester : VI Course Code : 16UCS504 Syllabus UNIT II: The Wireless Markup Language: Overview The WML Document Model WML Authoring URLs Identify Content

More information

INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT

INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT Robert Capra Spring 2013 Note: These lecture notes are based on the tutorials on XML, XPath, and XSLT at W3Schools: http://www.w3schools.com/ and from

More information

XML (Extensible Markup Language

XML (Extensible Markup Language XML (Extensible Markup Language XML is a markup language. XML stands for extensible Markup Language. The XML standard was created by W3C to provide an easy to use and standardized way to store self describing

More information

How the Internet Works

How the Internet Works How the Internet Works The Internet is a network of millions of computers. Every computer on the Internet is connected to every other computer on the Internet through Internet Service Providers (ISPs).

More information

Why HTML5? Why not XHTML2? Learning from history how to drive the future of the Web

Why HTML5? Why not XHTML2? Learning from history how to drive the future of the Web Why HTML5? Why not XHTML2? Learning from history how to drive the future of the Web Michael(tm) Smith mike@w3.org http://people.w3.org/mike sideshowbarker on Twitter, GitHub, &c W3C Interaction domain

More information

Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming

Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming Outline XML recap Formatting CSS or XSL? XPath XSL/XSLT XSL-FO XML Programming Slide 2 XML markup recap XML based on

More information

Tutorial on text transformation with pure::variants

Tutorial on text transformation with pure::variants Table of Contents 1. Overview... 1 2. About this tutorial... 1 3. Setting up the project... 2 3.1. Source Files... 4 3.2. Documentation Files... 5 3.3. Build Files... 6 4. Setting up the feature model...

More information

Oracle Application Server 10g Oracle XML Developer s Kit Frequently Asked Questions September, 2005

Oracle Application Server 10g Oracle XML Developer s Kit Frequently Asked Questions September, 2005 Oracle Application Server 10g Oracle XML Developer s Kit Frequently Asked Questions September, 2005 This FAQ addresses frequently asked questions relating to the XML features of Oracle XML Developer's

More information

XML Master: Professional V2

XML Master: Professional V2 XML I10-002 XML Master: Professional V2 Version: 4.0 QUESTION NO: 1 Which of the following correctly describes the DOM (Level 2) Node interface? A. The Node interface can be used to change the value (nodevalue)

More information

XML and Databases. Outline XML. XML, typical usage scenario XML. 1. extensible Stylesheet Language X M L. Sebastian Maneth NICTA and UNSW

XML and Databases. Outline XML. XML, typical usage scenario XML. 1. extensible Stylesheet Language X M L. Sebastian Maneth NICTA and UNSW Outline XML and Databases 1. extensible Stylesheet Language Transformations (XSLT) 2. Templates (match pattern action) Lecture 11 XSLT Stylesheets and Transforms Sebastian Maneth NICTA and UNSW 3. Default

More information

XML Wrap-up. CS 431 March 1, 2006 Carl Lagoze Cornell University

XML Wrap-up. CS 431 March 1, 2006 Carl Lagoze Cornell University XML Wrap-up CS 431 March 1, 2006 Carl Lagoze Cornell University XSLT Processing Model Input XSL doc parse Input XML doc parse Parsed tree serialize Input XML doc Parsed tree Xformed tree Output doc (xml,

More information

UNIT I. A protocol is a precise set of rules defining how components communicate, the format of addresses, how data is split into packets

UNIT I. A protocol is a precise set of rules defining how components communicate, the format of addresses, how data is split into packets UNIT I Web Essentials: Clients, Servers, and Communication. The Internet- Basic Internet Protocols -The World Wide Web-HTTP request message-response message- Web Clients Web Servers-Case Study. Markup

More information

introduction to XHTML

introduction to XHTML introduction to XHTML XHTML stands for Extensible HyperText Markup Language and is based on HTML 4.0, incorporating XML. Due to this fusion the mark up language will remain compatible with existing browsers

More information

MP3 (W7,8,&9): HTML Validation (Debugging) Instruction

MP3 (W7,8,&9): HTML Validation (Debugging) Instruction MP3 (W7,8,&9): HTML Validation (Debugging) Instruction Objectives Required Readings Supplemental Reading Assignment In this project, you will learn about: - Explore accessibility issues and consider implications

More information

Computer Science E-1. Understanding Computers and the Internet. Lecture 10: Website Development Wednesday, 29 November 2006

Computer Science E-1. Understanding Computers and the Internet. Lecture 10: Website Development Wednesday, 29 November 2006 Computer Science E-1 Understanding Computers and the Internet Lecture 10: Website Development Wednesday, 29 November 2006 David J. Malan malan@post.harvard.edu 1 Agenda Webservers Structure Permissions

More information

XHTML & CSS CASCADING STYLE SHEETS

XHTML & CSS CASCADING STYLE SHEETS CASCADING STYLE SHEETS What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner version

More information

blink.html 1/1 lectures/6/src/ form.html 1/1 lectures/6/src/

blink.html 1/1 lectures/6/src/ form.html 1/1 lectures/6/src/ blink.html 1/1 3: blink.html 5: David J. Malan Computer Science E-75 7: Harvard Extension School 8: 9: --> 11:

More information

XSLT. Lecture 38. Robb T. Koether. Mon, Apr 21, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XSLT Mon, Apr 21, / 26

XSLT. Lecture 38. Robb T. Koether. Mon, Apr 21, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XSLT Mon, Apr 21, / 26 XSLT Lecture 38 Robb T. Koether Hampden-Sydney College Mon, Apr 21, 2014 Robb T. Koether (Hampden-Sydney College) XSLT Mon, Apr 21, 2014 1 / 26 1 XSLT 2 Running XSLT 3 XSLT Files 4 Output Modes 5 XSLT

More information

Implementing a chat button on TECHNICAL PAPER

Implementing a chat button on TECHNICAL PAPER Implementing a chat button on TECHNICAL PAPER Contents 1 Adding a Live Guide chat button to your Facebook page... 3 1.1 Make the chat button code accessible from your web server... 3 1.2 Create a Facebook

More information

XML: Managing with the Java Platform

XML: Managing with the Java Platform In order to learn which questions have been answered correctly: 1. Print these pages. 2. Answer the questions. 3. Send this assessment with the answers via: a. FAX to (212) 967-3498. Or b. Mail the answers

More information

Manipulating XML Trees XPath and XSLT. CS 431 February 18, 2008 Carl Lagoze Cornell University

Manipulating XML Trees XPath and XSLT. CS 431 February 18, 2008 Carl Lagoze Cornell University Manipulating XML Trees XPath and XSLT CS 431 February 18, 2008 Carl Lagoze Cornell University XPath Language for addressing parts of an XML document XSLT Xpointer XQuery Tree model based on DOM W3C Recommendation

More information

Introduction to XML. M2 MIA, Grenoble Université. François Faure

Introduction to XML. M2 MIA, Grenoble Université. François Faure M2 MIA, Grenoble Université Example tove jani reminder dont forget me this weekend!

More information

OWASP. XML Attack Surface. Business Analytics Security Competency Group

OWASP. XML Attack Surface. Business Analytics Security Competency Group XML Attack Surface Business Analytics Security Competency Group XML is Pervasive 2/32 XML intro Born in 1998 (see initial specifications) Data interchange format Parsers International languages support

More information

PrintShop Web. Print Production Integration Guide

PrintShop Web. Print Production Integration Guide PrintShop Web Print Production Integration Guide Copyright Information Copyright 1994-2010 Objectif Lune Inc. All Rights Reserved. No part of this publication may be reproduced, transmitted, transcribed,

More information

Semi-structured Data 11 - XSLT

Semi-structured Data 11 - XSLT Semi-structured Data 11 - XSLT Andreas Pieris and Wolfgang Fischl, Summer Term 2016 Outline What is XSLT? XSLT at First Glance XSLT Templates Creating Output Further Features What is XSLT? XSL = extensible

More information

Creating A Web Page. Computer Concepts I and II. Sue Norris

Creating A Web Page. Computer Concepts I and II. Sue Norris Creating A Web Page Computer Concepts I and II Sue Norris Agenda What is HTML HTML and XHTML Tags Required HTML and XHTML Tags Using Notepad to Create a Simple Web Page Viewing Your Web Page in a Browser

More information

Using ASP to generate dynamic WAP content

Using ASP to generate dynamic WAP content C H A P T E R 1 9 Using ASP to generate dynamic WAP content 19.1 Introduction 303 19.2 Creating a dynamic WAP application 304 19.3 Testing using WAP emulators 305 19.4 Sending and retrieving data 309 19.5

More information

WIRIS quizzes web services Getting started with PHP and Java

WIRIS quizzes web services Getting started with PHP and Java WIRIS quizzes web services Getting started with PHP and Java Document Release: 1 2010 december, Maths for More www.wiris.com Summary This document provides client examples for PHP and Java. Contents WIRIS

More information

IBM WebSphere software platform for e-business

IBM WebSphere software platform for e-business IBM WebSphere software platform for e-business XML Review Cao Xiao Qiang Solution Enablement Center, IBM May 19, 2001 Agenda What is XML? Why XML? XML Technology Types of XML Documents DTD XSL/XSLT Available

More information

ajax1.html 1/2 lectures/7/src/ ajax1.html 2/2 lectures/7/src/

ajax1.html 1/2 lectures/7/src/ ajax1.html 2/2 lectures/7/src/ ajax1.html 1/2 3: ajax1.html 5: Gets stock quote from quote1.php via Ajax, displaying result with alert(). 6: 7: David J. Malan 8: Dan Armendariz 9: Computer Science E-75 10: Harvard Extension School 11:

More information

Lecture 12. PHP. cp476 PHP

Lecture 12. PHP. cp476 PHP Lecture 12. PHP 1. Origins of PHP 2. Overview of PHP 3. General Syntactic Characteristics 4. Primitives, Operations, and Expressions 5. Control Statements 6. Arrays 7. User-Defined Functions 8. Objects

More information

How browsers talk to servers. What does this do?

How browsers talk to servers. What does this do? HTTP HEADERS How browsers talk to servers This is more of an outline than a tutorial. I wanted to give our web team a quick overview of what headers are and what they mean for client-server communication.

More information

Greenstone 3 Interface Transformations Library: Basic Documentation

Greenstone 3 Interface Transformations Library: Basic Documentation Greenstone 3 Interface Transformations Library: Basic Documentation 1. Introduction Greenstone 3 has the flexibility of using XSLT to display the web interface using transformations. It is a great tool

More information

Transformation mit XSLT/XPath

Transformation mit XSLT/XPath Transformation mit XSLT/XPath Seminar Dokumentenverarbeitung Sommersemester 2002 Jörn Clausen Transformation mit XSLT/XPath p.1/10 Technikalitäten Dateien in /vol/lehre/dokumentenverarbeitung/ Environment

More information

COP 4814 Florida International University Kip Irvine XSLT. Updated: 2/9/2016 Based on Goldberg, Chapter 2. Irvine COP 4814

COP 4814 Florida International University Kip Irvine XSLT. Updated: 2/9/2016 Based on Goldberg, Chapter 2. Irvine COP 4814 COP 4814 Florida International University Kip Irvine XSLT Updated: 2/9/2016 Based on Goldberg, Chapter 2 XSL Overview XSL Extensible Stylesheet Language A family of languages used to transform and render

More information

Introduction to Web Technologies

Introduction to Web Technologies Introduction to Web Technologies James Curran and Tara Murphy 16th April, 2009 The Internet CGI Web services HTML and CSS 2 The Internet is a network of networks ˆ The Internet is the descendant of ARPANET

More information

Using htmlarea & a Database to Maintain Content on a Website

Using htmlarea & a Database to Maintain Content on a Website Using htmlarea & a Database to Maintain Content on a Website by Peter Lavin December 30, 2003 Overview If you wish to develop a website that others can contribute to one option is to have text files sent

More information

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5 2 Basics of XML and XML documents 2.1 XML and XML documents Survivor's Guide to XML, or XML for Computer Scientists / Dummies 2.1 XML and XML documents 2.2 Basics of XML DTDs 2.3 XML Namespaces XML 1.0

More information

Goal DTD. <!ATTLIST CD id ID #REQUIRED. <!ATTLIST Track disk ( ) '1'>

Goal DTD. <!ATTLIST CD id ID #REQUIRED. <!ATTLIST Track disk ( ) '1'> Goal Build a web site for a company that sells CD over the web Desing a XML application for capturing CD information Title, author, band, price, category, songs The web site should allow browsing by category

More information

store process communicate

store process communicate store process communicate 2011-10-04 store as XML communicate using HTML and CSS process with XSL

More information

Extensions to XSLT 1.0, and XSLT 2.0

Extensions to XSLT 1.0, and XSLT 2.0 ... Extensions A typical problem: XSLT 1.0 does not have any way of finding the current date and time. However, some XSLT 1.0 processors allow you to use extensions to XSLT 1.0. The EXSLT initiative http://www.exslt.org/

More information

1. Documenting your project using the Eclipse help system

1. Documenting your project using the Eclipse help system 1. Documenting your project using the Eclipse help system Build easy-to-use and searchable help documentation Arthur Barr, Software engineer, IBM Summary: The Eclipse Platform, which provides a very powerful

More information