Re: [xsl] Xselerator

Subject: Re: [xsl] Xselerator
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Thu, 19 Jul 2007 15:56:24 +0300
Hi Andrew and Abel,

If you are in the XSLT Debugger perspective then you do not need to configure a transformation scenario to perform a transformation - you can use the debugger run to end command to transform. The XML and XSL files are specified in the XML and XSL como boxes so in case you have more files open you need to check those combo boxes to make sure you have the desires XML and XSL selected.

oXygen detects automatically the xml-stylesheet PI if you try to execute the transform action on a file and in that case it will ask you if you want to use that stylesheet for the transformation. Note also that when you configure a scenario you can choose between specifying the XML and XSLT locations and using the xml-stylesheet processing instruction.

Best Regards,
George Cristian Bina -
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Abel Braaksma (online) wrote:
Great - I'll take a look.  If I don't have to set up a
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