Ah. You have a namespace, and so you either need to scope the /plugin path
or specify it as the 'local' name.

Try this:

<attr path="/:plugin" attr="version" value="{whatever}"/>

Basically if a namespace is defined, then you'll need to qualify all your
nodes with a ':'. e.g. /:a/:b/:c

Brian

On Fri, January 30, 2009 16:18, Edmund Spatzenegger wrote:
> I was using XMLTask for parsing an midifiying an XML File but it did not
> work as expected.
> The XML file im am parsing lhas the followin structure:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <plugin xmlns="http://www.sun.com/schema/SPS";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        description="myplugin"
>        name="myplugin"
>        schemaVersion="5.2"
>        vendor="Sun Microsystems "
>        version="1.0"
>        xsi:schemaLocation="http://www.sun.com/schema/SPS plugin.xsd">
>
> ................
>
> </plugin>
>
>
> what I am trying to do ist to modify the "version" attribute in the
> <plugin> tag. But I cant locate it using XMLTask:
> Here's my Ant snippet:
>
>        <xmltask
> source="${plugin.jar.dir}/main/${plugin.descriptor.name}"
> dest="${plugin.content.dir}/${plugin.descriptor.name}">
>            <attr path="/plugin" attr="version" value="${plugin.version}"/>
>        </xmltask>
>
> but this won't  change anything.
>
> Next I tried to use wildcards:
>        <xmltask
> source="${plugin.jar.dir}/main/${plugin.descriptor.name}"
> dest="${plugin.content.dir}/${plugin.descriptor.name}">
>            <attr path="/*" attr="version" value="${plugin.version}"/>
>        </xmltask>
> This worked fine but I'm afraid this will also modify other occurences
> of verion attributes.
> Can anybody tell me what's wrong with my first approach?
>
> Regards
>
> Edmund
>
> --
> *******************************************************************
> Edmund Spatzenegger           IT-Architect
> Systems Practice              Phone:  +49 (0)89 46008-2574
> Sun Microsystems GmbH         Fax:    +49 (0)89 46008-2583
> Sonnenalle 1                  Mobile: +49 (0)172 8441648
> 85551 Kirchheim-Heimstetten   mailto:edmund.spatzeneg...@sun.com
> Germany
> http://www.sun.de
>
> Amtsgericht München: HRB 161028
> Geschäftsführer: Thomas Schröder, Wolfgang Engels, Dr. Roland Bömer
> Vorsitzender des Aufsichtsrates: Martin Häring
> *******************************************************************
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Xmltask-users mailing list
> Xmltask-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xmltask-users
>


-- 
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to