Set up Transformation Scenario with linked stylesheet?

Here should go questions about transforming XML with XSLT and FOP.
RBVanDyke
Posts: 37
Location: San Francisco, California USA

Set up Transformation Scenario with linked stylesheet?

Mon Feb 08, 2016 1:18 am

For oxygen 17.1 --

IF I have an XML file that references a linked stylesheet, THEN how can I configure an oXygen XML transformation scenario to run the transformation without explicitly specifying the stylesheet in the scenario's XML URL text entry area?

My XML file contains the following statement:

Code: Select all

<?xml-stylesheet type="text/xsl" href="02list11.xsl"?>

IF I try to create a Transformation Scenario that relies on that statement to specify the XSL file rather than specify the path to in the scenario, THEN oXygen tells me You need a valid XSL URL as input.

I've looked at the various $-options and can't identify which of these, if any, would enable the Transformation Scenario to use the XSL stylesheet referenced in the aforementioned xml-stylesheet type= statement contained in the XML file.

How, then, if at all does one set up an oXygen XML Transformation Scenario to use the stylesheet referenced in the file pointed to by the scenario dialog box's XML URL file?

Thanks for your help,
Riley
SFO
RBVanDyke
Posts: 37
Location: San Francisco, California USA

Re: Set up Transformation Scenario with linked stylesheet?

Mon Feb 08, 2016 1:26 am

Also: In the Transformation Scenario dialog I see a Use "xml-stylesheet" declaration check box. But I can't select it. What's the trick to enabling that checkbox?

Cheers & thanks
Riley
SFO
RBVanDyke
Posts: 37
Location: San Francisco, California USA

Re: Set up Transformation Scenario with linked stylesheet?

Mon Feb 08, 2016 1:34 am

And I also meant XSL URL, not XML URL. Sorry. Sigh...
RBVanDyke
Posts: 37
Location: San Francisco, California USA

Re: Set up Transformation Scenario with linked stylesheet?

Mon Feb 08, 2016 1:57 am

ALSO, I have looked at this oXygen XML 17.1 online help topic:

https://www.oxygenxml.com/doc/versions/ ... t-tab.html#xslt-tab

That online help topic might benefit from clarifying how to enable the Use "xml-stylesheet" declaration check box. I'm normally able to figure out how to solve these problems but I'm truly stumped at how to to tell a Transformation Scenario to use a linked stylesheet declaration...

Cheers & hope this helps,
Riley
adrian
Posts: 2391

Re: Set up Transformation Scenario with linked stylesheet?

Mon Feb 08, 2016 6:32 pm

Hi,

RBVanDyke wrote:IF I have an XML file that references a linked stylesheet, THEN how can I configure an oXygen XML transformation scenario to run the transformation without explicitly specifying the stylesheet in the scenario's XML URL text entry area?
You may have created a scenario of the wrong type (e.g. "XSLT transformation") that's why the Use "xml-stylesheet" declaration option is unavailable. You need to create a new XML transformation with XSLT scenario. Follow these steps:

1. Open the XML document that has the "xml-stylesheet" declaration.
2. From the main menu invoke Document -> Transformation -> "Configure Transformation Scenario(s)" (there's a corresponding button in the toolbar)
3. In the "Configure Transformation Scenario(s)" dialog press "New" and select "XML transformation with XSLT" to create a new scenario.
4. Leave the "XML URL" field to its default(${currentFileURL})
5. Enable the Use "xml-stylesheet" declaration option. The XSL URL field will be disabled.
6. If you have an XSLT 2.0 stylesheet choose from the transformer combo Saxon-PE, otherwise you can leave it to Saxon6.5.5.
7. (optional) You can further tune the "Output". Please note that the "Save as" field must refer a single file, NOT an output directory. Use the editor variables to compose a generic name instead of a fixed one.
e.g in the "Save as" field you can specify: ${cfd}/${cfn}-out.xml which translates into <current-file-directory>/<current-filename>-out.xml
8. Press OK in the editing dialog and "Save and close".

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
RBVanDyke
Posts: 37
Location: San Francisco, California USA

Re: Set up Transformation Scenario with linked stylesheet?

Mon Feb 08, 2016 7:53 pm

Adrian:

Thanks so much for your help! That worked.

Cheers & thanks 'gain,
Riley
SFO

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest