13xsl-2up - 13 XSL 30 Sept, 2010 CSCC09F Programming on the...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
13 XSL 30 Sept, 2010 CSCC09 Programming on the Web 1 13 XSLT CSCC09 Programming on the Web 1 eXtensible Stylesheet Language (XSL) usage, formatting, transformations, templates CSCC09F Programming on the Web 13 XSLT CSCC09 Programming on the Web 2 XSL Components b XSLT c An XML vocabulary for transforming an XML document into another (text) document b " Unlike with a programming language, you don't need to be a programmer to successfully describe how to transform your information. XSLT implements transformation ‘by example’, not just ‘by program logic’, and builds in support for the kinds of transformation typically needed to present information.” c would that life were so easy… b XPath c A language for addressing parts of XML documents (covered in separate slide set) b XSL Formatting Objects (FO) c an XML vocabulary to define XML presentation c designed for very high quality (e.g. print) c not covered in this course
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
13 XSL 30 Sept, 2010 CSCC09 Programming on the Web 2 13 XSLT CSCC09 Programming on the Web 3 XSL Applications 13 XSLT CSCC09 Programming on the Web 4
Background image of page 2
13 XSL 30 Sept, 2010 CSCC09 Programming on the Web 3 13 XSLT CSCC09 Programming on the Web 5 XSLT Structure b XSLT Namespace http://www.w3.org/1999/XSL/Transform b 1999 refers to the year the URI was allocated by W3C, not to the version of XSLT b Stylesheet root element <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> or (these 2 forms are synonymous) <xsl:transform version="2.0" …> b Combining stylesheets <xsl:include href=“uri-reference " /> (as if defined here) <xsl:import href=“uri-reference"/> (importer has priority, can override imported definitions) 13 XSLT CSCC09 Programming on the Web 6 b Consider the important application of transforming an XML document to XHTML, for display purposes. b This could happen in various places: c In a Web server . A CGI script or Servlet might convert XML documents stored on the server to XHTML documents that are sent to the client via HTTP. c In a Web browser . An XSL-enabled browser may convert XML downloaded from the server to XHTML, prior to display. Current versions of Firefox and IE support a subset of XSLT. c In a standalone program . XML stored in or generated from a database, say, may be converted to XHTML before placing it in the server’s document directory (e.g. Saxon invoked on server). Transforming XML to XHTML
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
13 XSL 30 Sept, 2010 CSCC09 Programming on the Web 4 13 XSLT CSCC09 Programming on the Web 7 Invoking XSLT Processor b server side (could be static, e.g. makefile, or dynamic, e.g. invoked by CGI like saxon.cgi, or by a Servlet) c java –jar /courses/webspace/cscc09f10/prof/lib/saxon8.jar file.xml file.xsl b client side (run XSLT on the client) c PI for XSL included in XML document file.xml: <?xml-stylesheet type=“text/xsl” href=“file.xsl” ?> c XSLT-capable browser automatically invokes XSL processor when XML is loaded (e.g. Firefox, IE 7.0). 13 XSLT
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

13xsl-2up - 13 XSL 30 Sept, 2010 CSCC09F Programming on the...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online