Author: ltrieloff
Date: Wed Oct 25 13:07:43 2006
New Revision: 467749
URL: http://svn.apache.org/viewvc?view=rev&rev=467749
Log:
Update forms to include id attribute of a form group into a container element if not already
existing. Fixes COCOON-1944 by Rob Berens
Modified:
cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl?view=diff&rev=467749&r1=467748&r2=467749
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
Wed Oct 25 13:07:43 2006
@@ -735,9 +735,27 @@
<!--+
| fi:group - has no visual representation by default
+ | If the fi:group contains an id and has only one child that is not in the fi: namespace,
+ | then copy the id to the child. This is needed for ajax when grouping is just used
to group
+ | widgets.
+-->
+ <xsl:template match="fi:group[@id and count(*) = 1 and not(fi:*)]">
+ <xsl:apply-templates mode="copy-parent-id"/>
+ </xsl:template>
+
<xsl:template match="fi:group">
<xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="*" mode="copy-parent-id">
+ <xsl:copy>
+ <!-- do not override id if already specified, else use parent id -->
+ <xsl:if test="not(@id)">
+ <xsl:attribute name="id"><xsl:value-of select="../@id"/></xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
</xsl:template>
<xsl:template match="@*|node()" priority="-1">
|