Page 1 of 1

XSLT-available Parameter for current directory in refactoring tool

Posted: Thu May 14, 2020 1:03 am
by jeff_hooker
Hi folks,

I'm using the refactoring tool to process huge multi-level directory structure of XML. I'd like to use the result-document xslt process to create a number of sub-files from each existing file and dump the new files into the same directory as the file currently being processed. Is there a built-in parameter for url of the current file already existing within the refactoring tool that I could use to populate the href parameter of the result-document process? Barring that, do you have any recommendations for achieving this?

Thanks,
Jeff.

Re: XSLT-available Parameter for current directory in refactoring tool

Posted: Thu May 14, 2020 6:52 am
by Radu
Hi Jeff,

There is no such special parameter being passed to the XSLT stylesheet but you can use the base-uri() XSLT function to access the location of the current converted XML document.
For example we have our own refactoring operations which extract from a DITA topic the inner topics as separate files, in this XSLT stylesheet:
OXYGEN_INSTALL_DIR/frameworks/dita/refactoring/convert-nested-topics-to-new-topic.xsl there is a call to this function:

Code: Select all

  <xsl:variable name="proposalName" select="f:generateOutputFileName(., base-uri())"/>
and the generateOutputFileName function is defined in the stylesheet OXYGEN_INSTALL_DIR/frameworks/dita/refactoring/utils/xslt-convert-inner-elements-to-topics.xsl where it uses the XSLT resolve-uri() function to compute the location of the file to write.

Regards,
Radu