You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Charles Anthony <ch...@hpdsoftware.com> on 2002/08/12 10:50:18 UTC

RE: DVSL XPATH : Help Neede !

[...]

> <project>
>   <plugin name="foo">
>     <goal id="0" name="foo:bar">
>       <prerequisite name="prereq:one"/>
>       <prerequisite name="prereq:two"/>
>     </goal>
>   </plugin>
>   <plugin name="prereq">

[...]

> For this I need to get the node "/plugin/goal" whose name equals
> $prereq.attrib("name").

I think there's a confusion here with the root of your xpath expression..
you are asking for the /plugin/goal node - whereas the root of the snippet
is 'project'.

try /project/plugin/goal[@name='$prereqName']
or //plugin/goal[@name='$prereqName']

(/project makes it explicit, //plugin means "find every plugin/goal under
every node)

All E&OE (it's over a year since I've used XPATH)

Cheers,

Charles.


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DVSL XPATH : Help Neede !

Posted by Stéphane MOR <st...@yahoo.fr>.
Charles Anthony wrote:

>[...]
>
>  
>
>><project>
>>  <plugin name="foo">
>>    <goal id="0" name="foo:bar">
>>      <prerequisite name="prereq:one"/>
>>      <prerequisite name="prereq:two"/>
>>    </goal>
>>  </plugin>
>>  <plugin name="prereq">
>>    
>>
>
>[...]
>
>  
>
>>For this I need to get the node "/plugin/goal" whose name equals
>>$prereq.attrib("name").
>>    
>>
>
>I think there's a confusion here with the root of your xpath expression..
>you are asking for the /plugin/goal node - whereas the root of the snippet
>is 'project'.
>
>try /project/plugin/goal[@name='$prereqName']
>or //plugin/goal[@name='$prereqName']
>
>(/project makes it explicit, //plugin means "find every plugin/goal under
>every node)
>
>All E&OE (it's over a year since I've used XPATH)
>
>Cheers,
>
>Charles.
>  
>
Thanx a lot !!!

It did just what I wanted, and that was a VERY quick answer (around 1 
minute if I trust mozilla mail ..) !
Are you a member of Geir-the-typing-monster's family ? :)

Cheers,
Stéphane


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>