cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carmona Perez, David" <>
Subject Woody error summary
Date Fri, 07 Nov 2003 10:44:56 GMT
Here is a custom version of woody-samples-styling.xsl, I made that think can be of general
I've added the new <wi:validation-errors> tag that show a summary of errors that may
have happened, and can be embedded inside the <wt:form-template> tag.
What do you think?
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
      <xsl:import href="woody-page-styling.xsl"/>
      <xsl:import href="woody-field-styling.xsl"/>
      <!-- head and body stuff required to use the calendar popup -->
      <xsl:template match="head">
                  <!-- insert the head snippets required by the styling stylesheets -->
                  <xsl:call-template name="woody-page-head"/>
                  <xsl:call-template name="woody-field-head"/>
                  <link rel="stylesheet" type="text/css" href="woody-tabs.css"/>
      <xsl:template match="body">
                  <!-- insert the body  snippets required by the styling stylesheets -->
                  <xsl:call-template name="woody-page-body"/>
                  <xsl:call-template name="woody-field-body"/>
      <xsl:template match="wi:validation-errors">
            <xsl:param name="header">
                  <p class="validation-errors">The following errors have been detected
(marked with !):</p>
            <xsl:param name="footer">
                  <p class="validation-errors">Please, correct them and re-submit the
            <xsl:variable name="frm" select="ancestor::wi:form-template"/>
            <xsl:if test="$frm and $frm//wi:validation-message">
                  <xsl:copy-of select="$header"/>
                        <xsl:for-each select="$frm//wi:validation-message">
                             <li class="validation-error">
                                   <xsl:if test="../wi:label">
                                         <xsl:value-of select="../wi:label"/><xsl:text>:
                                   <xsl:value-of select="."/>
                  <xsl:copy-of select="$footer"/>

View raw message