Here you go..
<file input.xml>
<?xml version="1.0" encoding="UTF-8"?>
<configuration version="1" />
</file>
<file maven.xml>
<goal name="xmlTagTest">
<j:file name="output.xml" prettyPrint="true" xmlns="dummy">
<u:file var="xmlFile" name="input.xml" />
<x:parse var="doc" xml="${xmlFile}"/>
<x:set var="versions" select="$doc/configuration/@version" />
<j:set var="version" value="${versions[0]}" />
<j:set var="newVersionStr" value="${version.getValue() + 1}" />
${version.setValue(newVersionStr)}
<!-- ${version.setValue('${newVersionStr}')} -->
<!-- see if changes is good -->
<ant:echo>${version} </ant:echo>
<x:copyOf select="$doc" />
</j:file>
</goal>
</file>
-Dan
On Mon, 20 Sep 2004 21:28:36 +1000, Dion Gillard <[EMAIL PROTECTED]> wrote:
> Can you give us a sample to test?
>
> On Fri, 17 Sep 2004 19:28:07 -0700, dan tran <[EMAIL PROTECTED]> wrote:
> >
> >
> > I did try that way as well, and version attribute does not change.
> >
> > It may be a bug then.
> >
> > -D
> >
> > On Sat, 18 Sep 2004 11:34:13 +1000, Dion Gillard <[EMAIL PROTECTED]> wrote:
> > > On Fri, 17 Sep 2004 17:32:51 -0700, dan tran <[EMAIL PROTECTED]> wrote:
> > > > I am getting closer with this code:
> > > >
> > > > <j:file name="junk.xml" prettyPrint="true" xmlns="dummy">
> > > > <u:file var="xmlFile" name="classic.configuration.xml" />
> > > > <x:parse var="doc" xml="${xmlFile}"/>
> > > > <x:set var="versions"
> > > > select="$doc/configuration/configuration-id/@version" />
> > > > <j:set var="version" value="${versions[0]}" />
> > > > <j:set var="newVersionStr" value="${version.getValue() + 1}" />
> > > > ${version.setValue('${newVersionStr}')}
> > >
> > > The above line is wrong.
> > >
> > > it should be:
> > > ${version.setValue(newVersionStr)}
> > >
> > > quoted stuff is a literal string.
> > > --
> > > http://www.multitask.com.au/people/dion/
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> http://www.multitask.com.au/people/dion/
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]