On Wednesday 12 June 2002 16:13, Murat �nalan wrote:

Well, it is actually a bit tricky. The thing is your page will be in an 
uncertain state if there are errors. For instance if you had XSP something 
like:

<except:try>
   <tag1>
     <mytaglib:sometagthatcanfail/>
     <tag2>
         <mytaglib:someothertagthatcanfail/>
     </tag2>
   </tag1>
<except:catch>
   <error>An error message: <except:message/></error>
</except:catch>
</except:try>

Then you could end up with various scenarios for output. If your first tag 
fails, then you would end up with <tag1><error>....</error></tag1> but if its 
the second tag that fails, then you would have 
<tag1>...<tag2><error>...</error></tag2></tag1>

What I finally did was to put a tag at the top level of my XSP like:

<collecterrors/>

and then in XSLT I match on /page/collecterrors and do a

<xsl:template match="/page/collecterrors">
  <xsl:apply-templates match="//error"/>
</xsl:template>

now you can figure out if there was an error. There are various strategies to 
use from there. One would be to set up a mode variable, etc. It depends on 
whether or not you have an error thats recoverable or not. If it is then you 
can process everything else as usual, otherwise you might want to generate a 
totally different page (in which case you probably would just redirect from 
the try block in XSP anyway).


>
> Has anybody an idea how to develop a more general/generic xslt (with
> template parameters for example),
> so it would nicely display form errors for any form ? I mean the
> 'payment' stuff etc could be substituted
> with general variables/parameters.
>

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

Reply via email to