On Wed, Jun 12, 2002 at 06:26:39PM +0200, Murat �nalan wrote:
> :: included with <xsl:apply-templates match="/page/form"/>. 
> :: That way the "look 
> :: and feel" of your site is pretty much in one place.
> 
> Thanx for the idea,
> but I hate cluttering and tweaking with <:include> or stuff.
> 
> And i don't aggree. What could be more ingenious than having a simple
> perform_html.xsl
> which could be added to your translation-pipeline ?! I thought this
> was the clean concept of axkit/perform.
> 
> After solving, i feel really comfortable with perform and will stick to
> it.
> 
> Murat

If find myself doing the following so that I don't have to style or design
inside of xsp's much and just leave the styling and reorganizing to xsl
.... (with validation error codes too).  Anyway there's allways a
million ways ....

<xsl:template match="form[@name='payment']">
  <xsl:if test=".//error">
    <div class="form_errors">
      <ul>
        <xsl:if test=".//error[text()='missing']">
          <li>Please complete any required fields.</li>
        </xsl:if>
        <xsl:for-each select=".//error[text() != 'missing']">
          <li><xsl:apply-templates select="."/></li>
        </xsl:for-each>
      </ul>
    </div>
  </xsl:if>
  <form name="{@name}" action="{@action}" method="{@method}" enctype="{@enctype}">
    <xsl:apply-templates select="hidden"/>
    <xsl:apply-templates select="submit_button[name='send_payment']"/>
    <xsl:apply-templates select="payment"/>
  </form>
</xsl:template>

<xsl:template match="form[@name='payment']/payment">
  <div class="payment">
    <xsl:apply-templates select="textfield[name='cc_number']"/>
    <xsl:apply-templates select="single_select[name='cc_exp_month']"/>
    <xsl:apply-templates select="single_select[name='cc_exp_year']"/>
  </div>
</xsl:template>

<xsl:template match="form">
  <xsl:message>Unknown form: '<xsl:value-of select="@name"/>'</xsl:message>
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="error">
  <xsl:message>Unknown error: '<xsl:value-of select="name(parent::node())"/>' =  
'<xsl:value-of select="."/>'</xsl:message>
  <xsl:text>(unknown error):  </xsl:text><xsl:apply-templates/>
</xsl:template>

<xsl:template match="textfield[name='cc_number']/error[text()='invalid']">
  <xsl:text>Please Check your Credit Card Number and try again.</xsl:text>
</xsl:template>

<xsl:template match="textfield[name='cc_exp_month']/error[text()='expired']">
  <xsl:text>Your Credit Card is Expired</xsl:text>
</xsl:template>

<xsl:template match="textfield[name='cc_exp_year']/error[text()='expired']">
<!-- noop -->
</xsl:template>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to