Set attrValue="true" in the copy. The XPath defined below identifies the attribute name/value pair. Unfortunately there's no Xpath syntax to identify an attribute value separately, hence the additional instruction.
<copy path="path/to/@attribute" attrValue="true" property="..."/> On Thu, June 14, 2007 09:23, [EMAIL PROTECTED] wrote: > Hi, > > > > I'm trying to read a property from a feature-file that looks like this: > > > > <?xml version="1.0" encoding="UTF-8"?> > > <feature id="test" label="test_Feature" nl="de" os="win32" > provider-name="test provider" version="1.2"> > > > > <description url="http://www.example.com/description"> > > [Enter Feature Description here.] > > </description> > > </feature> > > > > Now I want to read the version attribute to use it further on in my > Ant-script. I've tried the following solution: > > > > <copy path="feature/@version" property="property1"/> > > > > This throws the following exception: > > [xmltask] Can only copy/cut text() nodes and attribute values to > properties > > > > > > So how is it possible to read the version-attribute? > > > > Regards, > > C.P. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/_______________________________________________ > 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 DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Xmltask-users mailing list Xmltask-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xmltask-users