Newbie question on creating ANT scripts

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
4everJang
Posts: 11
Joined: Mon Oct 14, 2013 2:12 pm

Newbie question on creating ANT scripts

Post by 4everJang » Sat Feb 16, 2019 2:43 pm

Hello all,

I have created my first simple ANT script, which works well but uses absolute references to the file to be transformed.

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="rng2dtd">

<target name="dtd">
<xslt style="xsl/step_1.xsl" in="rng/myfile.rng" out="temp/tmp_1.rng"/>
<xslt style="xsl/step_2.xsl" in="temp/tmp_1.rng" out="temp/tmp_2.rng"/>
<xslt style="xsl/step_3.xsl" in="temp/tmp_2.rng" out="temp/tmp_3.rng"/>
<xslt style="xsl/step_4.xsl" in="temp/tmp_3.rng" out="temp/tmp_4.rng"/>
<xslt style="xsl/step_5.xsl" in="temp/tmp_4.rng" out="temp/tmp_5.rng"/>
<xslt style="xsl/step_6.xsl" in="temp/tmp_5.rng" out="dtd/myfile.dtd"/>
</target>

</project>

My newbie question is: how can I parameterize the 'myfile' to pick up the filename of the currently opened RNG file in oXygen ?
Another option I would like to see is how to invoke the series of transforms on all files that match a certain name pattern.

Thanks in advance

4everJang
Posts: 11
Joined: Mon Oct 14, 2013 2:12 pm

Re: Newbie question on creating ANT scripts

Post by 4everJang » Sat Feb 16, 2019 3:09 pm

I figured it out (passing the parameter). Creating a build that processes al files matching a pattern is still an open question, but not pressing at this time, and I am sure that will be fairly easy, too.

Thanks

Radu
Posts: 6507
Joined: Fri Jul 09, 2004 5:18 pm

Re: Newbie question on creating ANT scripts

Post by Radu » Mon Feb 18, 2019 8:23 am

Hi Jang,

Right, in the ANT transformation scenarios you create in Oxygen you can add ANT parameters and each parameter can have its value given by an Oxygen editor variable:

https://www.oxygenxml.com/doc/versions/ ... ables.html

About applying XSLT to multiple XML documents, inside the xslt task you can refer to a fileset:
topic10759.html#p30724

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply