L20-XSL - Session 20 XSLT Session 20 XML Transformations...

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

View Full Document Right Arrow Icon
Session 20 – XSLT 11/29/2010 1 © Robert Kelly, 2001-2010 Session 20 XML Transformations XSLT 1 Reading & Reference Reading XML in a Nutshell (Chapter 8) Book chapter (XML Bible) www.ibiblio.org/xml/books/bible2/chapters/ch17.html XSLT www-106.ibm.com/developerworks/library/x-xslt/ Reference © Robert Kelly, 2001-2010 2 XSLT - www.w3.org/TR/xslt X-Path - http://www.w3.org/TR/xpath
Background image of page 1

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

View Full DocumentRight Arrow Icon
Session 20 – XSLT 11/29/2010 2 © Robert Kelly, 2001-2010 Web Architecture Compatibility Choices for handling different browser devices: Write a new JSP for each different kind of device or browser Generate a single XML document in the JSP and transform it a document compatible with the device browser Choices for handling different XML data sources © Robert Kelly, 2001-2010 3 Force everyone to use your schema Translate a services XML document to your schema Extended Web Architecture Web layer Data source Clients JSP Pages Bean Custom Tag XML JDBC EJB sources Translation XML Translation © Robert Kelly, 2001-2010 4 servlets
Background image of page 2
Session 20 – XSLT 11/29/2010 3 © Robert Kelly, 2001-2010 Need for XML Translation When you use a Web service, you can obtain an xml document, but its schema may not be compatible with your application When you generate an xhtml document, it may not be sufficiently targeted to the requesting browser If you provide a Web service, you may want to translate the xml document you generate so that it is compatible with the users xml schema © Robert Kelly, 2001-2010 5 Use only a subset of an xml document by removing the parts you do not need – before accessing it in your JSP or custom tag Translation Input and output documents should be XML XSLT Stylesheet XHTML XML input could be any XML document (including XHTML VoiceXML XSLT Engine XML Mobile Profile Browser produced by your JSP) © Robert Kelly, 2001-2010 6 Presentation of XML data can be targeted to specific devices (e.g., phones) XML Another Web Server
Background image of page 3

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

View Full DocumentRight Arrow Icon
Session 20 – XSLT 11/29/2010 4 © Robert Kelly, 2001-2010 Style Sheets A means to separate viewing information from content Cascading Style Sheets (CSS) Applied to HTML Limited to pure viewing info (no content manipulation) XSL (Ex tensible S tyle L anguage) © Robert Kelly, 2001-2010 7 Transformation (e.g., server to server XML translation) - XSLT Formatting – XSL-FO XSLT (XSL Transformations) An extension to XSL for the transformation of XML documents into other XML documents XSLT St l Sh It d t h l d b XSLT Style Sheet An XML document Consists of a set of template rules implemented as pure functions (“if this condition is encountered on input, generate this output”) Order of rules is immaterial Input document should be well-formed (valid or invalid) © Robert Kelly, 2001-2010 8 Input XML document is treated as a tree structure and rules are applied to nodes in the tree Template rules can decide which node to process next Uses XPath – specifies a path to an element, relative to current node (or the root)
Background image of page 4
Session 20 – XSLT 11/29/2010 5 © Robert Kelly, 2001-2010
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/22/2011 for the course CSE 336 taught by Professor Kelly,r during the Fall '08 term at SUNY Stony Brook.

Page1 / 16

L20-XSL - Session 20 XSLT Session 20 XML Transformations...

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

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