You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tim Bachta <tb...@kopent.com> on 2003/06/26 17:06:02 UTC

xsl question

How would I do an if statement in xsl were I am testing for the value of
an element?  Example

 

<xsl:if test="deviation = 1">

.....

 

 

where my incoming xml looks like this:

 

de                      <deviation>0</deviation> 

  <                     <compleated-by>N/A</compleated-by> 

 

Thanks for the help

 

Tim Bachta

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: xsl question

Posted by Joydeep Bose <jo...@dotech.com>.
To be on the safer side put the fully qualified element:
eg test="/page/deviation = 1"

unless the if statement is in a for-each or something that selects the parent 
node of the deviation element.Then just "deviation" is fine.


Quoting Tim Bachta <tb...@kopent.com>:

> How would I do an if statement in xsl were I am testing for the value of
> an element?  Example
> 
>  
> 
> <xsl:if test="deviation = 1">
> 
> .....
> 
>  
> 
>  
> 
> where my incoming xml looks like this:
> 
>  
> 
> de                      <deviation>0</deviation> 
> 
>   <                     <compleated-by>N/A</compleated-by> 
> 
>  
> 
> Thanks for the help
> 
>  
> 
> Tim Bachta
> 
>  
> 
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org