[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL SVG?

Subject: RE: XSL SVG?
From: "Max Dunn" <maxdunn@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 10 Mar 2002 13:37:24 -0800
xmlns svg
Hi Richard,

I don't think inline SVG is so well implemented: also, you forgot the
namespace prefix on <line>. With IE and the Adobe SVG viewer, you can do
the following:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:svg="http://www.w3.org/2000/svg">
<xsl:template match="/">
<html>
<head>
<object id="AdobeSVG"
   classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2">
</object>
<xsl:processing-instruction name="import">
	<xsl:text>namespace="svg" implementation="#AdobeSVG"</xsl:text>
</xsl:processing-instruction>
</head>
<body>
<svg:svg width="300" height="300">
 <svg:line x1="127" y1="65" x2="127" y2="200" 
	style="stroke:rgb(0,0,0);stroke-width:2"/>
</svg:svg>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

But that will only work in IE with recent versions of the Adobe SVG
Viewer. It would certainly be nice if SVG were implemented in browsers
as just another namespace: there is a build of the Mozilla project that
does this, http://www.mozilla.org/projects/svg/ with examples/info at
http://www.croczilla.com/svg/

The transformation for that SVG implementation in Mozilla would be
something like:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns="http://www.w3.org/1999/xhtml"
 xmlns:svg="http://www.w3.org/2000/svg">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<html>
<head>
</head>
<body>
<svg:svg width="300" height="300">
 <svg:line x1="127" y1="65" x2="127" y2="200" 
 style="stroke:#000000; stroke-width:2;"/>
</svg:svg>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

More like what you were thinking of... 

You could also have two XSLT stylesheets (for HTML and SVG) and two ASP
files that run the transformations against a single XML source, i.e. in
the HTML output from the first ASP:
<embed src="svg.asp" width="width" height="height" type="image/svg+xml"
/> 
where svg.asp generates the SVG (with
Response.ContentType="image/svg+xml").


HTH,

Max


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Richard
Hallgren
Sent: Sunday, March 10, 2002 6:09 AM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  XSL SVG?


Hi everyone,

I'm trying to generate a simple SVG shape from a XSL page, 
if I a embed the external SVG picture it works fine but 
when I try to generate the shape from the xsl file I just 
can't get it to work... How can I solve this? The final 
output is HTML generated through ASP, here is the relevant 
code from the XSL file:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 xmlns:svg="http://www.w3.org/2000/svg"> 
<xsl:template match="/">
<HTML>
<HEAD/>
<BODY>
<svg:svg width="300" height="300">
 <line x1="127" y1="65" x2="127" y2="200" style="stroke:rgb
(0,0,0);stroke-width:2"/>
</svg:svg>
...

Thanks in advance,
Richard 
---------------------------
Richard Hallgren
richard.hallgren@xxxxxxx
+44 (0) 2890915132
+44 (0) 7816326858


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • XSL SVG?
    • Richard Hallgren - Sun, 10 Mar 2002 09:11:21 -0500 (EST)
      • Max Dunn - Sun, 10 Mar 2002 16:26:03 -0500 (EST) <=
        • naha - Sun, 10 Mar 2002 17:17:57 -0500 (EST)
      • Chris Bayes - Sun, 10 Mar 2002 20:09:04 -0500 (EST)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.