Re: [xsl] stylesheet expansion

Subject: Re: [xsl] stylesheet expansion
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 26 Dec 2007 21:34:18 +0100
Colin Paul Adams wrote:
Having read the spec. I'm under the impression that you do not need to
resort to such a trick. Nor indeed hard-code the imports (which make
the transformation immobile).

That's an interesting elaboration, thanks Colin. Indeed, my workaround makes it very immobile...



Then:


gestalt imports.xsl hello-world.xml

yielded:

text-main
text-included-2
text-included-1

So no junction/link trick is necessary with Gestalt.

Of course, using fragment identifiers is not reliable, as this is
implementation-defined behaviour.

I'm afraid this time I only did a test with Saxon. With platform/implementation dependent stuff like fragment identifiers or xpointers etc (or even the file: protocol itself) I should learn to test on several environments ;)



I then tried it on Saxon 9. It reports error XTSE0210, so I guess
Dr. Kay is ignoring the fragment identifier for the purposes of
XTSE0210. I guess it can be argued either way with that wording, and
perhaps it is deliberately ambiguous. The main point is that you don't
get an infinite recursion whilst compiling.

Indeed. Though in some languages, like C++/C, it is not uncommon to have such a loophole.


P.S. match="/" rather than a name="something"? Not my style (it's also
slightly inefficient, depending upon the size of the dummy document).

I use match="/" so that I can run the stylesheet on itself, without making a special case and having to resort to one dummy document per XSLT (and it is easier to configure). Using name="something" is something I normally use in practice (actually, both match + name). My oXygen test environment in Eclipse does not let me choose an initial template, hence the name="/" (and a well-known but little used processor, at least on this list, AltovaXML, does not support initial templates at all).


Thanks for this additional info Colin,

Cheers,
-- Abel Braaksma

Current Thread