Re: [xslt] Possible namespace-related bug in xsltproc
- From: Charles Bozeman <cbozeman hiwaay net>
- To: xslt gnome org
- Subject: Re: [xslt] Possible namespace-related bug in xsltproc
- Date: 06 Apr 2003 07:20:35 -0600
xsltproc is working like it is supposed to. The bug.svg file has a
default namespace but your stylesheet does not handle the default
namespace.
replace lines:
xmlns="http://www.w3.org/2000/svg"
<xsl:template match='svg'>
<xsl:template match='rect'>
with
xmlns:s="http://www.w3.org/2000/svg"
<xsl:template match='s:svg'>
<xsl:template match='s:rect'>
to get the stylesheet to work on bug.svg
BTW, this is the type of question you should ask on the XSL-list. Daniel
states this on the libxslt webpages (http://xmlsoft.org/XSLT/bugs.html).
On Sun, 2003-04-06 at 06:18, gregor@focusresearch.com wrote:
> [[ Moderator -- I posted this last night but it got queued. I've
> joined the list, so I'm reposting myself rather than waiting for
> it to go through your queue. I hope that is OK. ]]
>
> I've been tinkering with using xsltproc to apply XSL templates
> to modify SVG images produced by Sodipodi.
>
> I've been battling with behavior that I thought was due to
> mistakes made by me. Since that didn't lead to resolution,
> I entertained the possibility that xsltproc could have a
> problem.
>
> I've found that for an SVG document with a default namespace
> declaration in the root <svg> element, I have to run in --novalid
> mode, and I have to remove the xmlns="..." attribute from the
> root <svg> element to get even a simple XSL stylesheet to
> apply the way I think it should.
>
> I've distilled this down to a simple example, which I'll attach here.
> The tarball below contains a Makefile and a README that
> shows the output I get when running the Makefile. Also included
> is a simple SVG file with (bad.svg) and without (better.svg) the
> problem xmlns attribute. The same example.xsl file is used for
> all four tests (with and without --novalid for bad.svg and better.svg).
> Note that the example.xsl file contains xmlns attributes in its root
> element, as I've heard is required for proper execution of XSLT
> against XML with namespaces.
>
> Can any of you shed some light on this one for me? Does this
> fail with your setup, too? Have I committed any misdemeanors
> in the XSLT? Or, is there a namespace-related bug in xsltproc
> to which I'm falling victim?
>
>
>
>
> Regards,
>
> -- Gregor Purdy
--
Charles Bozeman <cbozeman@hiwaay.net>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]