Computer Science E-259 XML with Java, Java Servlet, and JSP Lecture 6: Namespaces in XML 1.1 (Second Edition), SVG 1.1, and XSL (XSL-FO) 1.1 29 November 2007 David J. Malan
[email protected]
1 Copyright © 2007, David J. Malan
. All Rights Reserved.
Computer Science E-259 Last Time
XSLT, Continued
2 Copyright © 2007, David J. Malan . All Rights Reserved.
Last Time XSLT 1.0, Continued
Data Types Conditions Iteration Iteration, Sorted Patterns Modes Built-In Templates, Revisited Priorities Includes Imports Variables Result Tree Fragments Copying Nodes Outputting Nodes Attribute Value Templates Multiple Source Documents Recursion Extension Elements and Functions
3 Copyright © 2007, David J. Malan . All Rights Reserved.
Computer Science E-259 This Time
Namespaces in XML 1.0 (Second Edition) SVG 1.1 XSL (XSL-FO) 1.1 Project 2
4 Copyright © 2007, David J. Malan . All Rights Reserved.
Namespaces in XML 1.0 (Second Edition) History
Recommendation as of 1/99. "XML namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references."
5 Copyright © 2007, David J. Malan . All Rights Reserved.
Namespaces in XML 1.0 (Second Edition) Declaring a unique URI
6
Source available at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/xml/ns1.xml.
Copyright © 2007, David J. Malan . All Rights Reserved.
Namespaces in XML 1.0 (Second Edition) Defaulting
a unique URI
7
Source available at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/xml/ns2.xml.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 History
Recommendation as of 1/03. “SVG is a language for describing two-dimensional graphics in XML. SVG allows for three types of graphic objects: vector graphic shapes (e.g., paths consisting of straight lines and curves), images and text.”
8 Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Bitmaps
9
Image from http://www.prepressure.com/image/bitmapvector.htm.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Bitmaps
10
Source of screen shot unknown.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Bitmaps
11 Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Vector Graphics
12
Image from http://www.macromedia.com/downloads/.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Vector Graphics
13
Image from http://www.adobe.com/support/downloads/main.html.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Animated Graphics
14
Screen shot from http://kartoweb.itc.nl/public_examples/UndergroundMorph.html.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Underground Graphics
15
Screen shot from http://home.referral.net.au/thesethings/svg/gtubemap.svgz.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Russian Graphics
16
Screen shot from http://www.aisee.com/svg/metro.htm.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Text This is SVG.
Adapted from http://www.adobe.com/svg/basics/getstarted2.html.
17
Viewable at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/svg/text.svg.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Shapes
Adapted from http://www.adobe.com/svg/basics/getstarted2.html.
18
Viewable at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/svg/text.svg.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Shapes
19
Excerpted from http://www.kevlindev.com/tutorials/basics/shapes/svg/index.htm.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Paths Paths are described using the following data attributes: "moveto" [M] (set a new current point), "lineto" [L] (draw a straight line), "curveto" [C] (draw a curve using a cubic Bezier), "arc" [A] (elliptical or circular arc), and "closepath" [z] (close the current path by drawing a line to the last "moveto" point).
Adapted from http://www.adobe.com/svg/basics/getstarted2.html.
20
Viewable at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/svg/path1.svg.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Paths Paths are described using the following data attributes: "moveto" [M] (set a new current point), "lineto" [L] (draw a straight line), "curveto" [C] (draw a curve using a cubic Bezier), "arc" [A] (elliptical or circular arc), and "closepath" [z] (close the current path by drawing a line to the last "moveto" point).
Adapted from http://www.adobe.com/svg/basics/getstarted2.html.
21
Viewable at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/svg/path2.svg.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Anchors
This is CSCI E-259.
22
Viewable at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/svg/anchor.svg.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 Using Definitions
23
Excerpted from http://www.kevlindev.com/tutorials/basics/shapes/svg/index.htm.
Copyright © 2007, David J. Malan . All Rights Reserved.
SVG 1.1 XTube
24
Viewable at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/svg/circle.svg.
Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 History
Extensible Stylesheet Language (XSL) Version 1.0 is a recommendation since 10/01. “Given a class of arbitrarily structured XML documents or data files, designers use an XSL stylesheet to express their intentions about how that structured content should be presented; that is, how the source content should be styled, laid out, and paginated onto some presentation medium, such as a window in a Web browser or a hand-held device, or a set of physical pages in a catalog, report, pamphlet, or book.” Builds on CSS2 and Document Style Semantics and Specification Language (DSSSL).
25 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 Rendering
Framemaker's Maker Interchange Format (MIF) HP's Printer Control Language (PCL) Java's Abstract Window Toolkit (AWT) Portable Document Format (PDF) Postscript Rich Text Format (RTF) Scalable Vector Graphics (SVG) Text XML Area Tree ...
26 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world hello, world 27
Source available at http://www.fas.harvard.edu/~cscie259/distribution/lectures/6/examples6/xsl/hello.fo.
Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 Terminology
master "pagination and layout specifications" flow "the content that is distributed into the pages" block "The fo:block formatting object is commonly used for formatting paragraphs, titles, headlines, figure and table captions, etc." inline "The fo:inline formatting object is commonly used for formatting a portion of text with a background or enclosing it in a border."
28 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
XML declaration
29 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
"This is the top node of the formatting object tree. It holds an fo:layout-master-set formatting object (which holds all masters used in the document), an optional fo:declarations, and one or more fo:page-sequence objects. Each fo:page-sequence represents a sequence of pages that result from formatting the content children of the fo:page-sequence."
30 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
"The fo:layout-master-set is a wrapper around all masters used in the document. This includes page-sequence-masters, page-masters, and region-masters."
31 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
"The fo:simple-page-master is used in the generation of pages and specifies the geometry of the page. The page may be subdivided into up to five regions: regionbody, region-before, region-after, regionstart, and region-end."
32 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
"Used in constructing a simple-pagemaster. This region specifies a viewport/reference pair that is located in the 'center' of the fo:simple-page-master."
33
Image from http://www.w3.org/TR/xsl/slice6.html, copyright © 1999 – 2003, W3C.
Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
"The fo:page-sequence formatting object is used to specify how to create a (sub-)sequence of pages within a document; for example, a chapter of a report. The content of these pages comes from flow children (consisting of the single fo:flow and any fo:static-content flow objects) of the fo:page-sequence. The layout of these pages comes from the fo:page-sequencemaster or page-master referenced by the master-reference trait on the fo:pagesequence."
34 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
"The content of the fo:flow formatting object is a sequence of flow objects that provides the flowing text content that is distributed into pages. . . . The flow-names reserved in XSL are: xsl-region-body, xsl-region-before, xsl-regionafter, xsl-region-start, xsl-region-end, xslbefore-float-separator, xsl-footnote-separator."
35 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 hello, world
"The fo:block formatting object is commonly used for formatting paragraphs, titles, headlines, figure and table captions, etc."
hello, world
36 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 Font Properties (plus fo:inline) hello, world
37 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 Text Properties (plus fo:inline)
38
Intended for students with previous Java programming and web development experience, this course introduces XML as a key enabling technology in today's e-business applications. Students will learn the fundamentals of XML: schemas, XSL stylesheets, and programmatic access using standard APIs. Building on these foundations, the course will explore in detail a number of case studies that utilize XML in e-business: e-commerce, web personalization, portals, and web services. Data modeling techniques in XML will be introduced in the context of the case studies. Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 Tables
Image from http://www.w3.org/TR/xsl/slice6.html, copyright © 1999 – 2003, W3C.
39 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 Multiple Blocks The Jabberwocky Lewis Carroll Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!
40
Example from http://www.renderx.com/Tests/doc/html/tutorial.html, copyright © 2000 – 2001, RenderX.
Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 With XSLT Jabberwocky Lewis Carroll 'Twas brillig, and the slithy tovesDid gyre and gimble in the wabe; All mimsy were the borogoves,And the mome raths outgrabe. "Beware the Jabberwock, my son!The jaws that bite, the claws that catch! Beware the Jubjub bird, and shunThe frumious Bandersnatch!" He took his vorpal sword in hand:Long time the manxome foe he sought-- So rested he by the Tumtum tree,And stood awhile in thought. And, as in uffish thought he stood,The Jabberwock, with eyes of flame, Came whiffling through the tulgey wood,And burbled as it came! One two! One two! And through and throughThe vorpal blade went snicker-snack! He left it dead, and with its headHe went galumphing back. "And hast thou slain the Jabberwock?Come to my arms, my beamish boy! O frabjous day! Callooh! Callay!"He chortled in his joy. 'Twas brillig, and the slithy tovesDid gyre and gimble in the wabe; All mimsy were the borogoves,And the mome raths outgrabe.
41 Copyright © 2007, David J. Malan . All Rights Reserved.
XSL (XSL-FO) 1.1 The Big Picture
Image from http://www.w3.org/TR/xsl/slice1.html, copyright © 1999 – 2003, W3C.
42 Copyright © 2007, David J. Malan . All Rights Reserved.
Next Time HTTP 1.1, JavaServer Pages 2.1, and Java Servlet 2.5
HTTP 1.1 n-Tier Enterprise Applications JavaServer Pages 2.1 Java Servlet 2.5 Project 3
43 Copyright © 2007, David J. Malan . All Rights Reserved.
Computer Science E-259 XML with Java, Java Servlet, and JSP Lecture 6: Namespaces in XML 1.1 (Second Edition), SVG 1.1, and XSL (XSL-FO) 1.1 29 November 2007 David J. Malan [email protected]
44 Copyright © 2007, David J. Malan . All Rights Reserved.