Re: [xslt] Possible namespace-related bug in xsltproc



Charles --

Thanks for the pointer. Now 3 cases work and 1 case fails, the
opposite of the prior behavior (better-novalid.out is the one that
fails to print "HAH!" now). I'll go work with my original stuff some
more to see if that helps enough to let me move on.

The reason I thought to post to this list was that the behavior was
inconsistent (--novalid affects the output), which it seems to me
shouldn't be the case...


Regards,

-- Gregor Purdy




Charles Bozeman <cbozeman@hiwaay.net>
Sent by: xslt-admin@gnome.org
04/06/2003 09:20 AM
Please respond to xslt

 
        To:     xslt@gnome.org
        cc: 
        Subject:        Re: [xslt] Possible namespace-related bug in xsltproc


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>

_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
xslt@gnome.org
http://mail.gnome.org/mailman/listinfo/xslt






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]