Just to clarify one point of this, in an xpath test app that I wrote, if
I run a query like this on a similar file, if I don't add a mapping for
the "empty" prefix to the appropriate namespace, a query using the blank
prefix fails with "Prefix must resolve to a namespace".  It only works
when I add the mapping from the "" prefix to the namespace.

> -----Original Message-----
> From: Brian Agnew [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 01, 2008 12:55 PM
> To: 'xmltask-users@lists.sourceforge.net'
> Subject: [Xmltask-users] [Fwd: Re: Reading out an attribute]
> 
> (forwarded due to mail problems)
> [forwarded message manually inserted here]
> A very quick test with your XML and the following:
>  
> <target name="abc">
> <xmltask source="input.xml">
>  <copy path="/:application/:module/@id" attrvalue="true"
property="dn_value"/> 
>  
> </xmltask>
> <echo>${dn_value}</echo>
> </target>
>  
> gives me WebModule_1213257640343
>  
> which appears to be correct. In the XPath examples you're looking at,
the chances are they don't involve namespaces. If your example contains
namespaces (e.g. in the below) then you have to qualify your XML
appropriately. The colon indicates the 'local' name of the XML node
(i.e. not including the namespace qualifier) and so XPath can resolve
your XPath query. Note that this is handled entirely by the XML
mechanism in the Java runtime and is not specific to XMLTask.
>  
> Hope that's of use!
>  
> Brian
>  
>  
>  
> Brian Agnew
> Hybrids IT Development
> Global Derivatives Team
>  
> Direct   +44 (0)20 7475 8259
> PO Box 52715, 30 Gresham Street, London EC2P 2XY 
> 
> 
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to