Page 1 of 1
XSLT transformation: Using editor variable in XSL URL
Posted: Thu Jul 10, 2014 6:51 pm
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:
However, I get an error message: "You need a valid XSL URL as input", so only absolute paths seem to work:
Is this a bug or am I missing something?
Kind regards,
Frank
Re: XSLT transformation: Using editor variable in XSL URL
Posted: Thu Jul 10, 2014 9:55 pm
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
Re: XSLT transformation: Using editor variable in XSL URL
Posted: Tue Jul 29, 2014 12:24 pm
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
Re: XSLT transformation: Using editor variable in XSL URL
Posted: Tue Aug 05, 2014 6:44 pm
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
Re: XSLT transformation: Using editor variable in XSL URL
Posted: Wed Aug 06, 2014 7:53 pm
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
Re: XSLT transformation: Using editor variable in XSL URL
Posted: Thu Aug 07, 2014 11:36 am
by Frank Ralf
Hi Adrian,
Many thanks for this thorough explanation!
Kind regards,
Frank