ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <stephane.baill...@haht.com>
Subject RE: xpath task
Date Thu, 14 Feb 2002 15:00:29 GMT
fu to ant-dev for further discussion on this topic. but feel free to enter a
rfe in bugzilla.
I don't have too much time to deal with this right now and need other point
of view as well.

What you want can be done as a specific task but I can't see why you want to
call it <xsl>.
<xpath> or <xml> fits better to this imho.

Concerning properties I don't know what can be done, and if we have to rely
on script to do this.

Assuming we have an <xpath> task that can set properties via xpath
expression and modify the xml we don't need to add a xpath support to
<property>. Solved.

Concerning regex, i'm style looking for a convenient syntaxt to manipulate
properties via regex.

maybe:
<property name="newprop" value="$$1">
   <regex input="a/path/to/a/File.java" pattern="(\w+.java)"/>
</property>

Cheer,

Stephane

> -----Original Message-----
> From: Tim Anderson [mailto:tima@intalio.com]
> Sent: Wednesday, February 13, 2002 10:28 PM
> To: Stephane Bailliez
> Subject: RE: xpath task
> 
> 
> In that case can I add a feature request? ;)
> 
> My requirement is to massage XML configuration files based on 
> ANT properties. In some cases I need to update attributes/elements,
> in others, comment them out. I guess what I'm really looking for
> is an <xsl> task eg:
> 
> <xsl file="input.xml">
>   <property name="elt.value" select="/root/node/element" />   
>         (1)
>   <apply select="/root/node/element" value="newvalue"/>
>   <apply select="/root/node/child/@attribute" value="newvalue"/>
>   <comment select="/root/node/list[name='test']' />           
>         (2)
> </xsl>
> 
> (1) - extract an attribute or element and stick it in a property
> (2) - comment the selected nodes
> 
> Thanks
> 
> Tim
> 
> 
> > -----Original Message-----
> > From: Stephane Bailliez [mailto:stephane.bailliez@haht.com]
> > Sent: Thursday, February 14, 2002 1:41 AM
> > To: tima@intalio.com
> > Subject: RE: xpath task
> > 
> > 
> > > -----Original Message-----
> > > From: Tim Anderson [mailto:tima@intalio.com]
> > 
> > >     I notice searching back through the mail archives that
> > > you proposed an xpath task for Ant mid last year.
> > > 
> > > Whatever became of it? Is it to be included in Ant, or
> > > has it been included and I can't find it?
> > > 
> > > The reason I ask is that I've spent several days using
> > > XSLT to generate property files from an XML file so
> > > they can be read in by ant and used in a <replace> task.
> > > This is not very rewarding - an <xpath> like task would
> > > have been much more straightforward. 
> > 
> > I completely forgot this one and would have been useful indeed.
> > I recently came across the need for a regexp as well.
> > 
> > Will check with other commiters what they think of it.
> > 
> > Stephane
> 

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message