You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jakob <ja...@jfix.com> on 2004/01/12 14:04:11 UTC

xslt task - multiple files output - question

Hi,

I searched the archive, and found some posts relating
approximately to my problem, but not entirely, and without
solution.

I have one input XML file, and want to use Xalan's
redirect extension to create a number of output files.

So, theoretically, I would use the "in" and "destdir"
attributes, correct?  However, it seems they cannot be
used together.  Only the "in" and "out", and the "basedir"
and "destdir" attribute pairs can be used together.

I have tried mixing the "in" and "destdir", but in this
case "in" is ignored, and "basedir" == "." is assumed.

I also tried to use "basedir" and "destdir" (which in my
scenario are the same), but now it converts the output of
the transformation as well, as it works recursively. ...

So, currently I am using this rather inelegant workaround
where I create a dummy outfile which is afterwards
deleted:

<xslt
 style="${dir.preparation}/fragment.xsl"
 in="${dir.data}/${ed.ibc}/lof/in.xml"
 out="${dir.data}/${ed.ibc}/lof/foo.bar">
 <xmlcatalog refid="xml.catalog"/>
</xslt>
<delete file="${dir.data}/${ed.ibc}/lof/foo.bar"/>

I do not like it, but it works.  I would be grateful for
any suggestion as to how to make it more elegant.  Thanks
in advance.

cheers,
Jakob.
--



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: xslt task - multiple files output - question

Posted by Jakob <ja...@jfix.com>.
Robert,

thanks for your response.

Robert Koberg said:
> Jakob wrote:
>
>> Hi,
>>
>> I searched the archive, and found some posts relating
>> approximately to my problem, but not entirely, and
>> without
>> solution.
>>
>> I have one input XML file, and want to use Xalan's
>> redirect extension to create a number of output files.
>
> If you are using something like Xalan's redirect
> extension then you  would manage where you write the
> file in the XSL. Perhaps you want to  pass a param the
> tell the transformation which (relative?) directory to
> go to.

I do that already.

> You would use the xslt task's out attribute to perhaps
> write a report of  what you have done.
>
> make sense?

well, it makes sense for some tasks (like the
junit-report), but it doesn't for others.  I really don't
need/want to create the report file.

anyway, it appears to me now that my problem may be
cosmetic rather than anything else.

cheers,
Jakob.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: xslt task - multiple files output - question

Posted by Robert Koberg <ro...@koberg.com>.
Jakob wrote:

> Hi,
> 
> I searched the archive, and found some posts relating
> approximately to my problem, but not entirely, and without
> solution.
> 
> I have one input XML file, and want to use Xalan's
> redirect extension to create a number of output files.

If you are using something like Xalan's redirect extension then you 
would manage where you write the file in the XSL. Perhaps you want to 
pass a param the tell the transformation which (relative?) directory to 
go to.

You would use the xslt task's out attribute to perhaps write a report of 
what you have done.

make sense?

-Rob


> 
> So, theoretically, I would use the "in" and "destdir"
> attributes, correct?  However, it seems they cannot be
> used together.  Only the "in" and "out", and the "basedir"
> and "destdir" attribute pairs can be used together.
> 
> I have tried mixing the "in" and "destdir", but in this
> case "in" is ignored, and "basedir" == "." is assumed.
> 
> I also tried to use "basedir" and "destdir" (which in my
> scenario are the same), but now it converts the output of
> the transformation as well, as it works recursively. ...
> 
> So, currently I am using this rather inelegant workaround
> where I create a dummy outfile which is afterwards
> deleted:
> 
> <xslt
>  style="${dir.preparation}/fragment.xsl"
>  in="${dir.data}/${ed.ibc}/lof/in.xml"
>  out="${dir.data}/${ed.ibc}/lof/foo.bar">
>  <xmlcatalog refid="xml.catalog"/>
> </xslt>
> <delete file="${dir.data}/${ed.ibc}/lof/foo.bar"/>
> 
> I do not like it, but it works.  I would be grateful for
> any suggestion as to how to make it more elegant.  Thanks
> in advance.
> 
> cheers,
> Jakob.
> --
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org