XML within Websites Philipp Glogowski - Stefan Mohr - Julia Wenzel University of Applied Sciences FHTW Berlin Index • 1. Introduction • 2. Overview about XML • 3. Website vs. PDA-View with an example • 4. Conclusions 1. Introduction • targets: • dynamic web site for www • PDA view • print version (pdf-format) 2. Overview about XML (1) • Extensible Markup Language • standard for creating documents • tree structure • readible by people & machines 2. Overview about XML (2) • data exchange format • generate any other formats • universally valid language • xml ≠ programming language ≠ database 2. Overview about XML (3) Content browser.html pda.html printer.html 2. Overview about XML (4) Content one xml file that is used to generate different website versions for a desktop-pc, a pda and a printer XMLFile XMLFO 3. Website vs. PDA-View • website view - general view with internet browser • pda view - mobile devices • shortened version web site – startpage PDA view – startpage <?xml version="1.0" encoding="utf-8"?> <xsp:page xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/cocoon/SQL/v2" xmlns:xsp-request="http://apache.org/xsp/request/2.0" language="java"> ... <content> <esql:execute-query> <esql:query> select id, spieler, tore, spiele, gelb, 2min, rot from mis_torschuetzen </esql:query> <esql:results> <rowset> <!-- für jede einzelene Ergebniszeile --> <esql:row-results> <row> <!-- damit holt man einen bestimmten Datensatz aus der Zeile der Tabelle --> <id><esql:get-int column="id"/></id> <spieler><esql:get-string column="spieler"/></spieler> <tore><esql:get-string column="tore"/></tore> <spiele><esql:get-string column="spiele"/></spiele> <gelb><esql:get-int column="gelb"/></gelb> <min2><esql:get-int column="2min"/></min2> <rot><esql:get-int column="rot"/></rot> </row> </esql:row-results> </rowset> </esql:results> </esql:execute-query> </content> ... </xsp:page> Header of the XML - File <?xml version="1.0" encoding="utf-8"?> <xsp:page xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/cocoon/SQL/ xmlns:xsp-request="http://apache.org/xsp/request/2.0" language="java"> ... Database SQL Query <content> <esql:execute-query> <esql:query> sql:query> select id, spieler, tore, spiele, gelb, 2min, rot from mis_torschuetze Database SQL Values <esql:results> <rowset> <esql:row-results> <row> <id><esql:get-int column="id"/></id> <spieler><esql:get-string column="spieler"/></spieler> <tore><esql:get-string column="tore"/></tore> <spiele><esql:get-string column="spiele"/></spiele> <gelb><esql:get-int column="gelb"/></gelb> <min2><esql:get-int column="2min"/></min2> <rot><esql:get-int column="rot"/></rot> </row> </esql:row-results> </rowset> </esql:results> </esql:execute-query> </content> ... </xsp:page> 4. Conclusions • one file for different devices • platform independency • quick & easy changes Thank you for your attention. Questions ???