XSLT to generate SVG tutorial: Difference between revisions
Jump to navigation
Jump to search
m (→Introduction) |
mNo edit summary |
||
Line 31: | Line 31: | ||
</div> | </div> | ||
== My first SVG from XML == | |||
Generating SVG with XSLT is really easy if you master some basic XSLT programming as explained in the [[XSLT Tutorial - Basics]]. Of course, you also should have some SVG basics. | |||
At the time of writing, you can serve SVG in three different ways on the web: | |||
# Embedded SVG in XHTML 1. This requires that you serve XHTML as XML. If you don't understand what that means, skip this option. | |||
# Generate a pure SVG file. All modern browsers can display that. | |||
# Generate an HTML5 file with inline SVG. All modern browsers can display that. | |||
== Links == | == Links == | ||
* [http://www.w3.org/People/maxf/papers/2002-07-SVGOpen/svgopen.html Using XSLT and SVG together: a survey of case studies] by Max Froumentin, Vincent Hardy, W3C, W3C/Sun Microsystems Inc. (2004). This is a somewhat outdated text, but I took some ideas from the introduction. | * [http://www.w3.org/People/maxf/papers/2002-07-SVGOpen/svgopen.html Using XSLT and SVG together: a survey of case studies] by Max Froumentin, Vincent Hardy, W3C, W3C/Sun Microsystems Inc. (2004). This is a somewhat outdated text, but I took some ideas from the introduction. |
Revision as of 16:58, 20 March 2013
<pageby nominor="false" comments="false"/>
This article or section is currently under construction
In principle, someone is working on it and there should be a better version in a not so distant future.
If you want to modify this page, please discuss it with the person working on it (see the "history")
Introduction
This tutorial will teach you how to generate SVG graphics from XML data. We will produce both pure SVG and HTML5 embedded SVG.
Learning goals
- Understand the purpose of XSLT, i.e. be able to think of XSLT as a translation language.
- Do simple transformations from XML to HTML
- Be able to use simple XPath expressions (tag and attribute names) in template selectors and for element and attribute extraction.
- Prerequisites
- Editing XML (being able to use a simple DTD). Catch up with the Editing XML tutorial
- XML namespaces (some, have a look at the XML namespace article)
- HTML and CSS (some)
- XSLT Tutorial - Basics
- Static SVG tutorial (important)
- SVG/SMIL animation tutorial (optional)
- Next steps
- XPath tutorial - basics
- XQuery tutorial - basics (if you have interest in XML databases)
- PHP - MySQL - XML tutorial - basics (shows how to display an XML result-set retrieved form MySQL with XSLT)
My first SVG from XML
Generating SVG with XSLT is really easy if you master some basic XSLT programming as explained in the XSLT Tutorial - Basics. Of course, you also should have some SVG basics.
At the time of writing, you can serve SVG in three different ways on the web:
- Embedded SVG in XHTML 1. This requires that you serve XHTML as XML. If you don't understand what that means, skip this option.
- Generate a pure SVG file. All modern browsers can display that.
- Generate an HTML5 file with inline SVG. All modern browsers can display that.
Links
- Using XSLT and SVG together: a survey of case studies by Max Froumentin, Vincent Hardy, W3C, W3C/Sun Microsystems Inc. (2004). This is a somewhat outdated text, but I took some ideas from the introduction.