You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2004/01/22 16:34:01 UTC
cvs commit: cocoon-2.1/src/blocks/woody/samples/resources woody-page-styling.xsl woody-field-styling.xsl woody-calendar-styling.xsl woody-advanced-field-styling.xsl
joerg 2004/01/22 07:34:01
Modified: src/blocks/woody/samples/resources woody-page-styling.xsl
woody-field-styling.xsl woody-calendar-styling.xsl
woody-advanced-field-styling.xsl
Log:
starting the refactoring of the woody stylesheets: separating the styling into separate templates
Revision Changes Path
1.15 +48 -44 cocoon-2.1/src/blocks/woody/samples/resources/woody-page-styling.xsl
Index: woody-page-styling.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-page-styling.xsl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- woody-page-styling.xsl 19 Jan 2004 14:09:46 -0000 1.14
+++ woody-page-styling.xsl 22 Jan 2004 15:34:01 -0000 1.15
@@ -30,54 +30,44 @@
to hold this state.
-->
<xsl:variable name="active">
+ <xsl:variable name="value" select="normalize-space(wi:state/wi:*/wi:value)"/>
<xsl:choose>
- <xsl:when test="wi:state">
- <xsl:variable name="value" select="wi:state/wi:*/wi:value"/>
- <xsl:choose>
- <xsl:when test="string-length($value) > 0"><xsl:value-of select="$value"/></xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
+ <xsl:when test="$value">
+ <xsl:value-of select="$value"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
-
<!-- copy the "state-widget" attribute for use in for-each -->
<xsl:variable name="state-widget" select="wi:state/wi:*/@id"/>
-
<xsl:variable name="id" select="generate-id()"/>
- <div id="{$id}">
+ <div id="{$id}">
<!-- add an hidden input for the state -->
<xsl:if test="$state-widget">
<input type="hidden" name="{$state-widget}" value="{$active}"/>
</xsl:if>
-
<!-- div containing the tabs -->
<div class="woody-tabArea">
<xsl:for-each select="wi:items/wi:*">
- <span id="{$id}_tab_{position() - 1}" onclick="woody_showTab('{$id}', {position() - 1}, {last()}, '{$state-widget}')">
- <xsl:choose>
- <xsl:when test="$active = (position() - 1)">
- <xsl:attribute name="class">woody-tab woody-activeTab</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="class">woody-tab</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
-
+ <xsl:variable name="pos" select="position() - 1"/>
+ <span id="{$id}_tab_{$pos}" onclick="woody_showTab('{$id}', {$pos}, {last()}, '{$state-widget}')">
+ <xsl:attribute name="class">
+ <xsl:text>woody-tab</xsl:text>
+ <xsl:if test="$active = $pos"> woody-activeTab</xsl:if>
+ </xsl:attribute>
<xsl:copy-of select="wi:label/node()"/>
- <xsl:if test=".//wi:validation-message">
+ <xsl:if test="wi:items/*//wi:validation-message">
<span style="color:red; font-weight: bold"> ! </span>
</xsl:if>
</span>
</xsl:for-each>
</div>
-
<!-- a div for each of the items -->
<xsl:for-each select="wi:items/wi:*">
- <div class="woody-tabContent" id="{$id}_items_{position() - 1}">
- <xsl:if test="$active != position() - 1">
+ <xsl:variable name="pos" select="position() - 1"/>
+ <div class="woody-tabContent" id="{$id}_items_{$pos}">
+ <xsl:if test="$active != $pos">
<xsl:attribute name="style">display:none</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="."/>
@@ -86,7 +76,6 @@
</div>
</xsl:template>
-
<!--
wi:group of type choice : a popup is used instead of tabs
-->
@@ -96,27 +85,24 @@
to hold this state.
-->
<xsl:variable name="active">
+ <xsl:variable name="value" select="normalize-space(wi:state/wi:*/wi:value)"/>
<xsl:choose>
- <xsl:when test="wi:state">
- <xsl:variable name="value" select="wi:state/wi:*/wi:value"/>
- <xsl:choose>
- <xsl:when test="string-length($value) > 0"><xsl:value-of select="$value"/></xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
+ <xsl:when test="$value">
+ <xsl:value-of select="$value"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
-
<!-- copy the "state-widget" attribute for use in for-each -->
<xsl:variable name="state-widget" select="wi:state/wi:*/@id"/>
-
<xsl:variable name="id" select="generate-id()"/>
+
<fieldset id="{$id}">
<legend>
<xsl:apply-templates select="wi:label/node()"/>
<select name="{$state-widget}" onchange="woody_showTab('{$id}', this.selectedIndex, {count(wi:items/*)}, '{$state-widget}')">
<xsl:for-each select="wi:items/wi:*">
+ <xsl:variable name="pos" select="position() - 1"/>
<option>
<xsl:attribute name="value">
<xsl:choose>
@@ -124,14 +110,14 @@
<xsl:value-of select="wi:value"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="position() - 1"/>
+ <xsl:value-of select="$pos"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
- <xsl:if test="$active = (position() - 1)">
+ <xsl:if test="$active = $pos">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
- <xsl:copy-of select="wi:label"/>
+ <xsl:copy-of select="wi:label/node()"/>
</option>
</xsl:for-each>
</select>
@@ -139,11 +125,11 @@
<span style="color:red; font-weight: bold"> ! </span>
</xsl:if>
</legend>
-
<!-- a div for each of the items -->
<xsl:for-each select="wi:items/wi:*">
- <div id="{$id}_items_{position() - 1}">
- <xsl:if test="$active != position() - 1">
+ <xsl:variable name="pos" select="position() - 1"/>
+ <div id="{$id}_items_{$pos}">
+ <xsl:if test="$active != $pos">
<xsl:attribute name="style">display:none</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="."/>
@@ -231,7 +217,11 @@
Default row layout : label left and input right
-->
<xsl:template match="wi:*" mode="group-row-content">
- <td valign="top"><label for="{@id}" title="{wi:hint}"><xsl:copy-of select="wi:label/node()"/></label></td>
+ <td valign="top">
+ <label for="{@id}" title="{wi:hint}">
+ <xsl:copy-of select="wi:label/node()"/>
+ </label>
+ </td>
<td><xsl:apply-templates select="."/></td>
</xsl:template>
@@ -255,7 +245,11 @@
Default rows layout : label above and input below
-->
<xsl:template match="wi:*" mode="group-rows-labels">
- <td valign="top"><label for="{@id}" title="{wi:hint}"><xsl:copy-of select="wi:label/node()"/></label></td>
+ <td valign="top">
+ <label for="{@id}" title="{wi:hint}">
+ <xsl:copy-of select="wi:label/node()"/>
+ </label>
+ </td>
</xsl:template>
<xsl:template match="wi:*" mode="group-rows-content">
@@ -265,7 +259,12 @@
<!-- boolean field : checkbox and label on a single line -->
<xsl:template match="wi:booleanfield" mode="group-columns-content">
<tr>
- <td colspan="2"><xsl:apply-templates select="."/> <label for="{@id}"><xsl:copy-of select="wi:label/node()"/></label></td>
+ <td colspan="2">
+ <xsl:apply-templates select="."/>
+ <label for="{@id}">
+ <xsl:copy-of select="wi:label/node()"/>
+ </label>
+ </td>
</tr>
</xsl:template>
@@ -284,9 +283,14 @@
</xsl:template>
<!-- double-list multivaluefield : lists under the label -->
- <xsl:template match="wi:multivaluefield[wi:styling/@list-type='double-listbox']" mode="group-columns-content">
+ <xsl:template match="wi:multivaluefield[wi:styling/@list-type='double-listbox']"
+ mode="group-columns-content">
<tr align="center">
- <td colspan="2"><label for="{@id}"><xsl:copy-of select="wi:label/node()"/></label></td>
+ <td colspan="2">
+ <label for="{@id}">
+ <xsl:copy-of select="wi:label/node()"/>
+ </label>
+ </td>
</tr>
<tr align="center">
<td colspan="2"><xsl:apply-templates select="."/></td>
1.32 +79 -95 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.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- woody-field-styling.xsl 22 Jan 2004 13:09:58 -0000 1.31
+++ woody-field-styling.xsl 22 Jan 2004 15:34:01 -0000 1.32
@@ -34,19 +34,14 @@
| Generic wi:field : produce an <input>
+-->
<xsl:template match="wi:field">
- <input name="{@id}" id="{@id}" value="{wi:value}" title="{normalize-space(wi:hint)}">
- <xsl:if test="wi:styling">
- <xsl:copy-of select="wi:styling/@*[not(name() = 'submit-on-change')]"/>
- </xsl:if>
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
+ <input name="{@id}" id="{@id}" value="{wi:value}" title="{wi:hint}">
+ <xsl:apply-templates select="." mode="styling"/>
</input>
<xsl:apply-templates select="." mode="common"/>
</xsl:template>
<!--+
- |
+ | Common stuff like wi:validation-message, @required or wi:help.
+-->
<xsl:template match="wi:*" mode="common">
<!-- validation message -->
@@ -59,6 +54,45 @@
</xsl:template>
<!--+
+ | Handling the common styling. You may only add attributes to the output
+ | as following handling (e.g. checked/unchecked) might add attributes too.
+ +-->
+ <xsl:template match="wi:*" mode="styling">
+ <xsl:apply-templates select="wi:styling/@*" mode="styling"/>
+ <!--+ @listbox-size needs to be handled separately as even if it is not
+ | specified some output (@size) must be generated.
+ | Separating this out into this common styling looks a bit like
+ | over-separation, doesn't it?
+ +-->
+ <xsl:if test="self::wi:field[wi:selection-list][wi:styling/@list-type = 'listbox'] or
+ self::wi:multivaluefield[not(wi:styling/@list-type = 'checkbox')]">
+ <xsl:variable name="size">
+ <xsl:value-of select="wi:styling/@listbox-size"/>
+ <xsl:if test="not(wi:styling/@listbox-size)">5</xsl:if>
+ </xsl:variable>
+ <xsl:attribute name="size">
+ <xsl:value-of select="$size"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="wi:styling/@*" mode="styling">
+ <xsl:copy-of select="."/>
+ </xsl:template>
+
+ <xsl:template match="wi:styling/@submit-on-change" mode="styling">
+ <xsl:if test=". = 'true'">
+ <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="wi:styling/@type | wi:styling/@list-type |
+ wi:styling/@list-orientation | wi:styling/@listbox-size"
+ mode="styling">
+ <!-- They are just markers for the stylesheet and don't go through to HTML. -->
+ </xsl:template>
+
+ <!--+
|
+-->
<xsl:template match="wi:help">
@@ -83,9 +117,7 @@
+-->
<xsl:template match="wi:field[wi:styling/@type='hidden']" priority="2">
<input type="hidden" name="{@id}" id="{@id}" value="{wi:value}">
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
+ <xsl:apply-templates select="." mode="styling"/>
</input>
</xsl:template>
@@ -94,14 +126,13 @@
| radio-buttons oriented according to @list-orientation
| ("horizontal" or "vertical" - default)
+-->
- <xsl:template match="wi:field[wi:selection-list and wi:styling/@list-type='radio']" priority="2">
+ <xsl:template match="wi:field[wi:selection-list][wi:styling/@list-type='radio']" priority="2">
+ <xsl:variable name="id" select="@id"/>
<xsl:variable name="value" select="wi:value"/>
<xsl:variable name="vertical" select="string(wi:styling/@list-orientation) != 'horizontal'"/>
<xsl:choose>
<xsl:when test="$vertical">
- <table cellpadding="0" cellspacing="0" border="0" title="{normalize-space(wi:hint)}">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="on-change" select="wi:styling/@submit-on-change"/>
+ <table cellpadding="0" cellspacing="0" border="0" title="{wi:hint}">
<xsl:for-each select="wi:selection-list/wi:item">
<tr>
<td>
@@ -109,9 +140,7 @@
<xsl:if test="@value = $value">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
- <xsl:if test="$on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
+ <xsl:apply-templates select="." mode="styling"/>
</input>
</td>
<td>
@@ -127,16 +156,13 @@
</table>
</xsl:when>
<xsl:otherwise>
- <span title="{normalize-space(wi:hint)}">
- <xsl:variable name="id" select="@id"/>
+ <span title="{wi:hint}">
<xsl:for-each select="wi:selection-list/wi:item">
<input type="radio" id="{generate-id()}" name="{$id}" value="{@value}">
<xsl:if test="@value = $value">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
+ <xsl:apply-templates select="." mode="styling"/>
</input>
<label for="{generate-id()}"><xsl:copy-of select="wi:label/node()"/></label>
</xsl:for-each>
@@ -149,31 +175,16 @@
<!--+
| wi:field with a selection list (not 'radio' style)
| Rendering depends on the attributes of wi:styling :
- | - if @list-type is "listbox" : produce a list box with @list-size visible
+ | - if @list-type is "listbox" : produce a list box with @listbox-size visible
| items (default 5)
| - otherwise, produce a dropdown menu
+-->
<xsl:template match="wi:field[wi:selection-list]" priority="1">
<xsl:variable name="value" select="wi:value"/>
- <xsl:variable name="liststyle" select="wi:styling/@list-type"/>
<!-- dropdown or listbox -->
- <select title="{normalize-space(wi:hint)}" id="{@id}" name="{@id}">
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
- <xsl:if test="$liststyle='listbox'">
- <xsl:attribute name="size">
- <xsl:choose>
- <xsl:when test="wi:styling/@listbox-size">
- <xsl:value-of select="wi:styling/@listbox-size"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>5</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
+ <select title="{wi:hint}" id="{@id}" name="{@id}">
+ <xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="wi:selection-list/wi:item">
<option value="{@value}">
<xsl:if test="@value = $value">
@@ -189,7 +200,7 @@
<!--+
| wi:field with a selection list and @type 'output'
+-->
- <xsl:template match="wi:field[wi:selection-list and wi:styling/@type='output']" priority="3">
+ <xsl:template match="wi:field[wi:selection-list][wi:styling/@type='output']" priority="3">
<xsl:variable name="value" select="wi:value"/>
<xsl:variable name="selected" select="wi:selection-list/wi:item[@value = $value]"/>
<xsl:choose>
@@ -206,28 +217,18 @@
| wi:field with @type 'textarea'
+-->
<xsl:template match="wi:field[wi:styling/@type='textarea']">
- <textarea id="{@id}" name="{@id}" title="{normalize-space(wi:hint)}">
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="wi:styling/@*[not(name() = 'type' or name() ='submit-on-change')]"/>
+ <textarea id="{@id}" name="{@id}" title="{wi:hint}">
+ <xsl:apply-templates select="." mode="styling"/>
<!-- remove carriage-returns (occurs on certain versions of IE and doubles linebreaks at each submit) -->
- <xsl:copy-of select="translate(wi:value/node(), ' ','')"/>
+ <xsl:copy-of select="translate(wi:value/node(), ' ', '')"/>
</textarea>
<xsl:apply-templates select="." mode="common"/>
</xsl:template>
<!--+
- | wi:field with @type 'output' : rendered as text
+ | wi:field with @type 'output' and wi:output are both rendered as text
+-->
- <xsl:template match="wi:field[wi:styling/@type='output']" priority="2">
- <xsl:copy-of select="wi:value/node()"/>
- </xsl:template>
-
- <!--+
- | wi:output
- +-->
- <xsl:template match="wi:output">
+ <xsl:template match="wi:output | wi:field[wi:styling/@type='output']" priority="2">
<xsl:copy-of select="wi:value/node()"/>
</xsl:template>
@@ -235,12 +236,9 @@
| wi:booleanfield : produce a checkbox
+-->
<xsl:template match="wi:booleanfield">
- <input id="{@id}" type="checkbox" value="true" name="{@id}" title="{normalize-space(wi:hint)}">
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="@*[not(name() = 'submit-on-change')]"/>
- <xsl:if test="wi:value/text() = 'true'">
+ <input id="{@id}" type="checkbox" value="true" name="{@id}" title="{wi:hint}">
+ <xsl:apply-templates select="." mode="styling"/>
+ <xsl:if test="wi:value = 'true'">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</input>
@@ -265,9 +263,9 @@
| wi:action
+-->
<xsl:template match="wi:action">
- <input id="{@id}" type="submit" name="{@id}" title="{normalize-space(wi:hint)}">
+ <input id="{@id}" type="submit" name="{@id}" title="{wi:hint}">
<xsl:attribute name="value"><xsl:value-of select="wi:label/node()"/></xsl:attribute>
- <xsl:copy-of select="wi:styling/@*"/>
+ <xsl:apply-templates select="." mode="styling"/>
</input>
</xsl:template>
@@ -275,14 +273,11 @@
| wi:continuation-id : produce a hidden "continuation-id" input
+-->
<xsl:template match="wi:continuation-id">
- <xsl:choose>
- <xsl:when test="@name">
- <input name="{@name}" type="hidden" value="{.}"/>
- </xsl:when>
- <xsl:otherwise>
- <input name="continuation-id" type="hidden" value="{.}"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:variable name="name">
+ <xsl:value-of select="@name"/>
+ <xsl:if test="not(@name)">continuation-id</xsl:if>
+ </xsl:variable>
+ <input name="{$name}" type="hidden" value="{.}"/>
</xsl:template>
<!--+
@@ -292,7 +287,7 @@
<xsl:variable name="id" select="@id"/>
<xsl:variable name="values" select="wi:values/wi:value/text()"/>
- <span title="{normalize-space(wi:hint)}">
+ <span title="{wi:hint}">
<xsl:for-each select="wi:selection-list/wi:item">
<xsl:variable name="value" select="@value"/>
<input id="{generate-id()}" type="checkbox" value="{@value}" name="{$id}">
@@ -314,18 +309,9 @@
<xsl:variable name="id" select="@id"/>
<xsl:variable name="values" select="wi:values/wi:value/text()"/>
- <span title="{normalize-space(wi:hint)}">
+ <span title="{wi:hint}">
<select id="{@id}" name="{$id}" multiple="multiple">
- <xsl:attribute name="size">
- <xsl:choose>
- <xsl:when test="wi:styling/@listbox-size">
- <xsl:value-of select="wi:styling/@listbox-size"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>5</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
+ <xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="wi:selection-list/wi:item">
<xsl:variable name="value" select="@value"/>
<option value="{$value}">
@@ -347,12 +333,12 @@
<xsl:choose>
<xsl:when test="wi:value">
<!-- Has a value (filename): display it with a change button -->
- <span title="{normalize-space(wi:hint)}">
+ <span title="{wi:hint}">
[<xsl:value-of select="wi:value"/>] <input type="submit" id="{@id}" name="{@id}" value="..."/>
</span>
</xsl:when>
<xsl:otherwise>
- <input type="file" id="{@id}" name="{@id}" title="{normalize-space(wi:hint)}" accept="{@mime-types}"/>
+ <input type="file" id="{@id}" name="{@id}" title="{wi:hint}" accept="{@mime-types}"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="." mode="common"/>
@@ -405,8 +391,8 @@
<xsl:apply-templates/>
<!-- TODO: consider putting this in the xml stream from the generator? -->
- <xsl:if test="local-name(.) = 'form-generated' ">
- <input type="submit" />
+ <xsl:if test="self::wi:form-generated">
+ <input type="submit"/>
</xsl:if>
</form>
</xsl:template>
@@ -419,12 +405,12 @@
<xsl:for-each select="wi:children/*">
<tr>
<xsl:choose>
- <xsl:when test="local-name(.) = 'repeater'">
+ <xsl:when test="self::wi:repeater">
<td valign="top" colspan="2">
<xsl:apply-templates select="."/>
</td>
</xsl:when>
- <xsl:when test="local-name(.) = 'booleanfield'">
+ <xsl:when test="self::wi:booleanfield">
<td> </td>
<td valign="top">
<xsl:apply-templates select="."/>
@@ -447,10 +433,8 @@
</xsl:template>
<xsl:template match="wi:aggregatefield">
- <input id="{@id}" name="{@id}" value="{wi:value}" title="{normalize-space(wi:hint)}">
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
+ <input id="{@id}" name="{@id}" value="{wi:value}" title="{wi:hint}">
+ <xsl:apply-templates select="." mode="styling"/>
</input>
<xsl:apply-templates select="." mode="common"/>
</xsl:template>
1.5 +1 -4 cocoon-2.1/src/blocks/woody/samples/resources/woody-calendar-styling.xsl
Index: woody-calendar-styling.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-calendar-styling.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- woody-calendar-styling.xsl 22 Jan 2004 13:09:58 -0000 1.4
+++ woody-calendar-styling.xsl 22 Jan 2004 15:34:01 -0000 1.5
@@ -59,10 +59,7 @@
<!-- regular input -->
<input id="{@id}" name="{@id}" value="{wi:value}">
- <xsl:if test="wi:styling/@submit-on-change='true'">
- <xsl:attribute name="onchange">woody_submitForm(this)</xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="wi:styling/@*[not(name() = 'type' or name() = 'submit-on-change')]"/>
+ <xsl:apply-templates select="." mode="styling"/>
</input>
<!-- calendar popup -->
1.4 +5 -12 cocoon-2.1/src/blocks/woody/samples/resources/woody-advanced-field-styling.xsl
Index: woody-advanced-field-styling.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-advanced-field-styling.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- woody-advanced-field-styling.xsl 22 Jan 2004 13:09:58 -0000 1.3
+++ woody-advanced-field-styling.xsl 22 Jan 2004 15:34:01 -0000 1.4
@@ -35,16 +35,6 @@
<xsl:template match="wi:multivaluefield[wi:styling/@list-type='double-listbox']">
<xsl:variable name="id" select="@id"/>
<xsl:variable name="values" select="wi:values/wi:value/text()"/>
- <xsl:variable name="size">
- <xsl:choose>
- <xsl:when test="wi:styling/@listbox-size">
- <xsl:value-of select="wi:styling/@listbox-size"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>5</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
<span class="woody-doubleList" title="{wi:hint}">
<table>
@@ -62,8 +52,9 @@
<tr>
<td>
<!-- select for the unselected values -->
- <select id="{@id}.unselected" name="{@id}.unselected" size="{$size}" multiple="multiple"
+ <select id="{@id}.unselected" name="{@id}.unselected" multiple="multiple"
ondblclick="opt{generate-id()}.transferRight()">
+ <xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="wi:selection-list/wi:item">
<xsl:variable name="value" select="@value"/>
<xsl:if test="not($values[. = $value])">
@@ -97,7 +88,9 @@
</td>
<td>
<!-- select for the selected values -->
- <select ondblclick="opt{generate-id()}.transferLeft()" id="{@id}" name="{@id}" size="{$size}" multiple="multiple">
+ <select id="{@id}" name="{@id}" multiple="multiple"
+ ondblclick="opt{generate-id()}.transferLeft()" >
+ <xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="wi:selection-list/wi:item">
<xsl:variable name="value" select="@value"/>
<xsl:if test="$values[. = $value]">