Ejen Logo
 
   <choose>


Description
Choose node is similar to the <xsl:choose> instruction. It may have any number of when nodes and one optional and ending otherwise node.
 
...
<foreach select="compilation-unit">
  <choose>
    <when test="@language='Java'">
      <template save="{@name}.java" uri="java.xsl"/>
    </when>
    <when test="@language='C' or @language='C++'">
      <template save="{@name}.c" uri="c.xsl"/>
    </when>
    <otherwise>
      <template save="{@name}.txt" uri="other.xsl"/>
    </otherwise>
  </choose>
</foreach>
...

Using this choose block with a couple of when nodes and one otherwise node, we can apply different XSL templates to specific XML contents.

Attribute Summary
 
NameDefault ValueOptionalAccepted Values
base true 

Attribute Detail
 
base
this is a generic block attribute that allows URI base redefinition: all uri attributes used in children nodes of this block will be relative to this new base definition (except if there is another child block node that redefines a new base). This is only a convenience attribute in order to simplify URI specifications. A base attribute must be a valid (well formed) URI, absolute or relative to another base definition.

Children
 
otherwise, when


SourceForge.net Logo