How to copy a file to the transformation folder

Here should go questions about transforming XML with XSLT and FOP.
rakefet286
Posts: 4
Joined: Thu Jul 04, 2013 5:19 pm

How to copy a file to the transformation folder

Post by rakefet286 »

Hi,

I have a general file html that I need for all webhelp transformations.
The transformation adds a link to that html file.
However, I can't seem to copy the file the source files to the folder woth the generated output.
I tried to add the copy to the build.xml or to the build_docbook.xml but I still cannot get it to work.
(I am new to XPATH etc...).

to the build_docbook.xml I tried to add the following to the <target name="copy-webhelp-resources"> section:

<property name="input-cr-dirs"
value="localization/**"/>
<dirname property="input-cr-basedir" file="${xml.file}"/>
<copy todir="${output.dir}/common" overwrite="true">
<fileset dir="${webhelp.plugin.path}oxygen-webhelp/resources/localization">
<include name="copyright.htm"/>
</fileset>
</copy>

To which file should I add something like this?
Is the code correct or did I miss something there?

Thanks,
Rakefet
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: How to copy a file to the transformation folder

Post by sorin_ristache »

Hi Rafeket,

Just add a <copy> element in the "copy-webhelp-resources" task in the build_common.xml file from the [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp directory (if you use the DITA Webhelp transformation) or from the [Oxygen-install-dir]\frameworks\docbook\xsl\com.oxygenxml.webhelp directory (if you use the Docbook Webhelp transformation).

Code: Select all

<copy todir="${output.dir}/oxygen-webhelp/resources" 
file="${webhelp.plugin.path}oxygen-webhelp/resources/copyright.htm"/>
I suggest placing your HTML file in the oxygen-webhelp/resources subdirectory of [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp (in case of DITA Webhelp) / [Oxygen-install-dir]\frameworks\docbook\xsl\com.oxygenxml.webhelp (in case of Docbook Webhelp) because that directory already contains some other HTML resource files.


Regards,
Sorin
rakefet286
Posts: 4
Joined: Thu Jul 04, 2013 5:19 pm

Re: How to copy a file to the transformation folder

Post by rakefet286 »

Thanks.
What is the difference between the build.xml and the build_common.xml and when should I use each one of them?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: How to copy a file to the transformation folder

Post by sorin_ristache »

Hi,

build_common.xml is imported in both build_dita.xml and build_docbook.xml because the tasks from build_common.xml are needed in both the DITA Map Webhelp transformation and the DocBook Webhelp one. One of these common tasks is "copy-webhelp-resources" and you should add your resource copy operation inside this task because this is what this task does: resource copy.

As I said above you should edit the build_common.xml file located in:
  • the [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp directory, if you apply the DITA Map Webhelp transformation on an input document of type DITA map,
  • the [Oxygen-install-dir]\frameworks\docbook\xsl\com.oxygenxml.webhelp directory, if you apply the DocBook Webhelp transformation on an input document of type DocBook.

Regards,
Sorin
rakefet286
Posts: 4
Joined: Thu Jul 04, 2013 5:19 pm

Re: How to copy a file to the transformation folder

Post by rakefet286 »

Thanks!
Post Reply