xsl-list
[Top] [All Lists]

Re: [xsl] null stylesheet?

2014-04-30 22:05:18
Syd,

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(_dot_)bauman(_at_)neu(_dot_)edu> 
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="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
    <xsl:template match="/"/>
  </xsl:stylesheet>

and that works perfectly well. But then I tried the slightly simpler

  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
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 9.5.1.3J 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 9.5.1.3 via oXygen 15.2
    5. Saxon-PE 9.5.1.3 via oXygen 15.2
    6. Saxon-EE 9.5.1.3 via oXygen 15.2







-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>