Re: [xsl] Xselerator

Subject: Re: [xsl] Xselerator
From: "Abel Braaksma (online)" <>
Date: Thu, 19 Jul 2007 14:17:46 +0200 (CEST)
> Great - I'll take a look.  If I don't have to set up a
> "transformation
> scenario" I'll be really happy...

I think you will have to anyway. But for most situations, one or two
scenario's will suffice: one that runs against itself (afaik, it is
still not possible to set an initial template and running against
oneself works around this) and one that runs against an xml file
with the same name: ${cfn}.xml.

Of course this may be unapplicable to your situation. Partially
because of this, partially for ease of debugging in general, I
provide my input and tests through a separate xml document that
follows a certain convention (like xml catalogs) and never use xml
input files directly.

If you need something like in Altova XML Spy, which uses a
processing instruction, you can of course mimic something similar:

  1. Create a transform scen on self xslt
  2. the xslt must have a PI, i.e., like <?input-xml myinput.xml?>
  3. start your xslt as follows:

<xsl:template match="processing-instruction()['input-xml']">
   <xsl:apply-templates select="document(.)/*" />

<xsl:template match="/xsl:stylesheet" priority="2" />

<!-- here start your normal stylesheet --.
<xsl:template match="/*">
   .... etc

Sorry, just thinking out loud, I guess (and all I come up with is
nothing more than an ugly workaround you weren't even asking for ;).
It would be nicer if one could somehow instruct Oxygen to use a
(list of) PIs or any other way that eases testing against xml
sources without the necessity of creating a transformation scenario
for each of them.

-- Abel Braaksma

Current Thread