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

Re: SVG Help

Subject: Re: SVG Help
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 1 Nov 2004 13:55:34 +0000
svg xsl
Hi Kent,

> I am trying to creat a very simple svg doc using the following source
> document: (August.xml)
>
> <?xml version='1.0'?>
> <?xml:stylesheet type="text/xsl" href="circle.svg.xsl"?>

That should be:

  <?xml-stylesheet type="text/xsl" href="circle.svg.xsl"?>
       ^
  hyphen, not colon

> using the following stylesheet: (circle.svg.xsl)
>
> <xsl:stylesheet
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>   xmlns:svg="http://www.w3.org/2000/svg"
>   xmlns:xlink="http://www.w3.org.1999/xlink">

If you're generating SVG, and don't want to use the 'svg' prefix
throughout your stylesheet, you should make the SVG namespace the
default namespace for the stylesheet. In other words, change:

  xmlns:svg="http://www.w3.org/2000/svg"

to:

  xmlns="http://www.w3.org/2000/svg"

> I have followed the format in Jeni Tennisons book "Beginning XSLT"
> But all I get is plain unformated text such as:
>
> "Timeline Markers This is textAugust"

The namespace issue is one problem: SVG processors will (should) only
recognize SVG that is in the SVG namespace.

The other problem is that I suspect you're expecting to simply load
the XML into Internet Explorer and have the SVG be shown
automatically. That won't happen: IE expects the result of any
transformation that it does to be an HTML document, and it will
display the result of any transformation as if it were an HTML
document. The result that you're getting is consistent with IE
ignoring non-HTML elements and just showing their contents.

If you want to do client-side transformation in IE, you need the
stylesheet to generate an HTML page containing an SVG object, and then
load the SVG image into that object. See Chris Bayes's DOM to DOM
utility at:

  http://www.bayes.co.uk/xml/portal.asp?page=/xml/index.xml&subpage=/xml/utils/domtodom.xml

for details.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Current Thread

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.