/[formed]/trunk/contrib/convert-choices.xsl
ViewVC logotype

Diff of /trunk/contrib/convert-choices.xsl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 30 by teichmann, Fri Aug 10 23:19:45 2007 UTC revision 31 by teichmann, Sat Aug 11 11:24:04 2007 UTC
# Line 11  Line 11 
11    
12          <xsl:template match="choice">          <xsl:template match="choice">
13                  <choice>                  <choice>
14                  <!-- iterate over all attributes -->                          <!-- copy all attributes except 'value' and 'options' -->
15                  <xsl:for-each select="@*">                          <xsl:copy-of select="@*[local-name() != 'value' and local-name() != 'options']"/>
16                          <xsl:choose>                          <!-- generate 'value' attribute with value of 'options' -->
17                                  <xsl:when test="name() = 'value' and current() = ''"/>                          <xsl:attribute name="value">
18                                          <!-- ignore old value attribute -->                                  <xsl:value-of select="@options"/>
19                                  <xsl:when test="name() = 'options'">                          </xsl:attribute>
                                         <!-- save old options attribute as value -->  
                                         <xsl:attribute name="value">  
                                                 <xsl:value-of select="."/>  
                                         </xsl:attribute>  
                                 </xsl:when>  
                                 <xsl:otherwise>  
                                         <!-- copy thru all other attributes -->  
                                         <xsl:attribute name="{name()}">  
                                                 <xsl:value-of select="."/>  
                                         </xsl:attribute>  
                                 </xsl:otherwise>  
                         </xsl:choose>  
                 </xsl:for-each>  
20                  </choice>                  </choice>
21          </xsl:template>          </xsl:template>
22    

Legend:
Removed from v.30  
changed lines
  Added in v.31

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26