Re: [xsl] null stylesheet?

Subject: Re: [xsl] null stylesheet?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxx>
Date: Thu, 1 May 2014 03:05:04 -0000

Note also that your two dummies will not return the same results.

The first (with the empty template matching '/') returns nothing. The
second (the true 'null stylesheet' with no contents) returns the text
contents of the input document, since that's what you get when you
match nothing but the built-in templates.

I suppose that's fine for what you want -- or at any rate you haven't
yet remarked on it. You did ask "what's supposed to happen", so I
answer, despite my suspicion that you know perfectly well. :-)

Cheers, Wendell

On Tue, Apr 29, 2014 at 6:23 PM, Syd Bauman <s.bauman@xxxxxxx> wrote:
> My apologies if this already appears in the archives or is already a
> known issue. Note: this is a very non-urgent issue, asked for the
> sake of completeness and curiosity.
> For various (slightly embarrassing) reasons I'd like a placeholder
> dummy XSLT 1.0 program. I initially wrote
>   <xsl:stylesheet xmlns:xsl=""; version="1.0">
>     <xsl:template match="/"/>
>   </xsl:stylesheet>
> and that works perfectly well. But then I tried the slightly simpler
>   <xsl:stylesheet xmlns:xsl=""; version="1.0"/>
> I think that is allowed by the 1.0 spec: ".. stylesheets may contain
> zero or more of each of these [top-level] elements". But I'm far from
> certain. In any case, most processors I have easy access to[1] are
> fine with it. But Saxon-HE run from the commandline
> complains that "The supplied file does not appear to be a stylesheet"
> (this is an error, not a warning; # XTSE0150).
> So ... what's supposed to happen? And if Saxon-HE 9.5 complains from
> the commandline, why does it not complain when run inside oXygen? (Is
> oXygen intercepting that message? Or perhaps oXygen is generating the
> message, and I just don't know where to look for such errors?)
> Notes
> -----
> [1] 1. xsltproc "Using libxml 20708, libxslt 10126 and libexslt 815"
>     2. Saxon 6.5.5 via oXygen 15.2
>     3. Xalan via oXygen 15.2
>     4. Saxon-HE via oXygen 15.2
>     5. Saxon-PE via oXygen 15.2
>     6. Saxon-EE via oXygen 15.2

Wendell Piez |
XML | XSLT | electronic publishing
Eat Your Vegetables

Current Thread