Jeni
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.
Going off slightly at a tangent, could I use the same trick to avoid having
to type xsl: throughout my stylesheets?
It would seem to work if my output is plain text but not if the output is an
xml document.
I've never seen any examples where the xsl: namespace prefix is not used,
would it be considered bad form anyway?
Regards
George
-----Original Message-----
From: Jeni Tennison [mailto:jeni(_at_)jenitennison(_dot_)com]
Sent: 01 November 2004 13:56
To: Kent Seegmiller
Cc: XSLT
Subject: Re: [xsl] SVG Help
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&subp
age=/xml/utils/domtodom.xml
for details.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--