XSLT transformation: Using editor variable in XSL URL

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Frank Ralf
Posts: 482
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

XSLT transformation: Using editor variable in XSL URL

Post by Frank Ralf »

Hi,

I want to us an oXygen editor variable in a XSLT transformation for providing a relative path to the XSLT file, like so:

Code: Select all

${frameworks}/custom_xslt/my.xsl
However, I get an error message: "You need a valid XSL URL as input", so only absolute paths seem to work:

Code: Select all

file:/T:/absolute/path/to/my.xsl
Is this a bug or am I missing something?

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
ionela
Posts: 407
Joined: Mon Dec 05, 2011 6:08 pm

Re: XSLT transformation: Using editor variable in XSL URL

Post by ionela »

Hi Frank,

${frameworks} editor variable is expanded to an URL that indicates the frameworks directory from the Oxygen XML Editor installation folder.

Unfortunately, we cannot reproduce this issue on our side as the "You need a valid XSL URL as input" message is obtained only if the XSL URL field is empty.

Could you please specify what version of oXygen are you using and please send us a screenshot with the "edit scenario" dialog? Please send it to our support email address: support AT oxygenxml DOT com.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
Frank Ralf
Posts: 482
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: XSLT transformation: Using editor variable in XSL URL

Post by Frank Ralf »

Hi Ionela,

Sorry for the late reply. I will try to reproduce the error and give you more details.

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 482
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: XSLT transformation: Using editor variable in XSL URL

Post by Frank Ralf »

Hi,

I found out that I have to prepend the XSL URL with "file:/" to make it work with an environment variable, like so (oXygen 15.2):

Code: Select all

file:/${env(DITA_XML_DIR)}/xslt/my_custom.xsl
I find this rather unintuitive considering the fact that for the XML URL field the plain variable "${currentFileURL}" is enough.

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: XSLT transformation: Using editor variable in XSL URL

Post by adrian »

Frank,

Oxygen relies heavily on URLs as opposed to the more commonly used file paths. If your environment variable contains a file/directory path, you do have to adjust it to be a URL for the fields that require it in that form, like XML URL and XSL URL.

${currentFileURL} always expands to a URL that points to the current edited file, while an environment variable can expand to anything, from a simple name or value to a file/folder path or even a URL (less likely though).

Note that Oxygen even provides two sets of editor variables, one that expands to URLs (e.g. ${pdu} - project directory URL) and one that expands to regular file/folder paths (e.g. ${pd} - project directory). Only one of the two sets is usually available in a field depending on the type of value accepted by that field. There are also common editor variables that provide simpler values which have to be composed in the appropriate form for that field, such is the case of ${env()}, ${system()}, ${date()}.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Frank Ralf
Posts: 482
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: XSLT transformation: Using editor variable in XSL URL

Post by Frank Ralf »

Hi Adrian,

Many thanks for this thorough explanation!

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Post Reply