Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] SVG Help

From: "G. Ken Holman" <gkholman@-------------------->
To:
Date: 11/1/2004 3:38:00 PM
At 2004-11-01 15:24 +0000, George James wrote:
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.

You can choose to use the default namespace for XSLT and an explicit 
namespace for your result XML ... that is an XML choice in writing your 
stylesheet, not a constraint.



But because of a lot of necessary default namespace declarations, it would 
be unwieldy to try and have both XSLT and your literal result elements take 
turns using the default namespace.



I've never seen any examples where the xsl: namespace prefix is not used,
would it be considered bad form anyway?

I do tell my students that while it isn't bad form, it can be awkward: when 
you want to use one of the reserved XSLT attributes in a literal result 
element, you are obliged to use a namespace prefix.  If you already have 
the "xsl" prefix declared, there is no extra work to do, but if you are 
using the default namespace for XSLT then you have to declare the use of a 
prefix for the literal result element to take advantage of the XSLT attribute.



So, I advise my students to use a prefix, typically "xsl:" for the XSLT 
instructions.



Note that I am a big fan (not sure there are any others!) of using the 
default namespace for the result tree when constructing using the XSL-FO 
vocabulary ... and I teach XSL-FO this way (without a namespace 
prefix).  Same rules: it is an XML decision to use the default namespace, 
not a stylesheet constraint.  Note, however, there are XSL-FO formatting 
engines and XML editing tools that are hardwired to the "fo:" prefix and 
are not doing appropriate namespace detection, and this will trip me up 
periodically, but for the most part I find working with the stylesheets 
easier when there is no prefix on the literal result elements.



So, in parallel, you may find there are editing tools or SVG processors out 
there that are not true XML applications in that they are not 
namespace-aware and they improperly trigger on the namespace prefix rather 
than the in-play namespace URI.  They may be expecting "svg:" when the 
default namespace is entirely appropriate due to XML rules.



I hope this helps.



....................... Ken




--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent