XSLT to generate SVG tutorial: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
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
Next steps

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:

  1. Embedded SVG in XHTML 1. This requires that you serve XHTML as XML. If you don't understand what that means, skip this option.
  2. Generate a pure SVG file. All modern browsers can display that.
  3. Generate an HTML5 file with inline SVG. All modern browsers can display that.


Links