vgritsenko    2003/11/15 17:00:17

  Modified:    src/blocks/woody/samples/resources woody-field-styling.xsl
  Log:
  Add templates for hidden fields, and for selection lists with type output.
  
  Revision  Changes    Path
  1.13      +29 -2     
cocoon-2.1/src/blocks/woody/samples/resources/woody-field-styling.xsl
  
  Index: woody-field-styling.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-field-styling.xsl,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- woody-field-styling.xsl   16 Nov 2003 00:55:25 -0000      1.12
  +++ woody-field-styling.xsl   16 Nov 2003 01:00:17 -0000      1.13
  @@ -82,6 +82,17 @@
     </xsl:template>
   
     <!--
  +    Hidden wi:field : produce input with type='hidden'
  +  -->
  +  <xsl:template match="wi:field[wi:[EMAIL PROTECTED]'hidden']]" priority="2">
  +    <input type="hidden" name="[EMAIL PROTECTED]" id="[EMAIL PROTECTED]" 
value="{wi:value}">
  +      <xsl:if test="wi:styling/@submit-on-change='true'">
  +        <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
  +      </xsl:if>
  +    </input>
  +  </xsl:template>
  +
  +  <!--
       wi:field with a selection list
       Rendering depends on the attributes of wi:styling :
       - if @list-type is "radio" : produce radio-buttons oriented according to 
@list-orientation
  @@ -145,6 +156,22 @@
     </xsl:template>
     
     <!--
  +    wi:field with a selection list and @type 'output'
  +  -->
  +  <xsl:template match="wi:field[wi:selection-list and wi:[EMAIL 
PROTECTED]'output']]" priority="2">
  +    <xsl:variable name="value" select="wi:value"/>
  +    <xsl:variable name="selected" select="wi:selection-list/wi:[EMAIL 
PROTECTED] = $value]"/>
  +    <xsl:choose>
  +      <xsl:when test="$selected/wi:label">
  +        <xsl:apply-templates select="$selected/wi:label"/>
  +      </xsl:when>
  +      <xsl:otherwise>
  +        <xsl:value-of select="$value"/>
  +      </xsl:otherwise>
  +    </xsl:choose>
  +  </xsl:template>
  +
  +  <!--
       wi:field with @type 'textarea'
     -->
     <xsl:template match="wi:field[wi:[EMAIL PROTECTED]'textarea']]">
  @@ -161,7 +188,7 @@
     <!--
       wi:field with @type 'output' : rendered as text
     -->
  -  <xsl:template match="wi:field[wi:[EMAIL PROTECTED]'output']]">
  +  <xsl:template match="wi:field[wi:[EMAIL PROTECTED]'output']]" priority="1">
       <xsl:copy-of select="wi:value"/>
     </xsl:template>
   
  @@ -297,7 +324,7 @@
       </span>
       <xsl:apply-templates select="." mode="common"/>
     </xsl:template>
  -  
  +
     <!--
       wi:upload
     -->
  
  
  

Reply via email to