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}')}
      
      <ant:echo>${version}  </ant:echo>
      
      <x:copyOf select="$doc" />
   </j:file>


The ant:echo statement shows to correct increament, but the 
x:copyOf shows my attribute as version=${newVersionStr}

What a bumper.!!!!

Oh well, I am going to try your xslt/jsl option.

-D


On Sat, 18 Sep 2004 02:12:53 +0200, Incze Lajos <[EMAIL PROTECTED]> wrote:
> On Fri, Sep 17, 2004 at 04:00:08PM -0700, dan tran wrote:
> > Ok, here is what i want.
> >
> > I need to change a attribute in a element in doc and then copy that
> > doc to another file. Sofar I am able to locate the attribute but dont
> > know how to change it.
> >
> > Here is my code
> >
> > <j:file name="newfile.xml" prettyPrint="true" xmlns="dummy">
> >   <u:file var="xmlFile" name="oldfile.xml" />
> >   <x:parse var="doc" xml="${xmlFile}"/>
> >   <x:set var="version" select="$doc/configuration/configuration-id/@version" />
> >   ${version.setValue('2')}
> >   <ant:echo>${version}  </ant:echo>
> >   <x:copyOf select="$doc" />
> > </j:file>
> >
> >
> > Dont think my method of alter the attribute working.
> >
> > Any help is greatly appreciated.
> >
> > -Dan
> 
> You simply changed the value of a variable extracted from
> and independent of your document. To change the version value
> in your output document, you have to _transform_ the original
> document with xsl or jsl.
> 
> incze
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to