RE: [transquery-discuss] Interoperability and xsl:param (was Re: Ananalogy)

From: Bryan Rasmussen (bry@itnisk.com)
Date: Wed Dec 12 2001 - 16:38:04 CET


-----Original Message-----
From: Evan Lenz [mailto:elenz@xyzfind.com]
Sent: 12. december 2001 16:16
To: Bryan Rasmussen; transquery-discuss@lists.oasis-open.org

>> I'm not sure it will work, because it doesn't
>>represent a first-class error condition for the user. Unless the
stylesheet
>>writer explicitly tests for the presence of x:error, then processing will
>>keep on going without any notice.

well most error conditions aren't first class anyway. what if you had
something like
<xsl:when test="$tq:input/tq:error[@code='500']>
I'm sorry, you have attempted to access information for which you don't have
access privileges, if you feel you've reached this error by mistake, keep
trying.
</xsl:when>
okay, that's probably even worse class, but most APIs allow for some sort of
error handling, I'm sure any Transquery Database would have error handling
of some sort. No I'm not suggesting a code attribute on the tq:error
element, it's an example. Not a good one, of course.

>>So it seems that the user would be required to do something like the
>>following in order to explicitly test for the error condition:

>><xsl:stylesheet version="1.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> xmlns:tq="http://www.xmlportfolio.com/transquery">

>> <xsl:param name="tq:input"/>

>> <xsl:template match="/">
>> <xsl:choose>
>> <xsl:when test="$tq:input/tq:error">
>> <xsl:message terminate="yes">
>> <xsl:value-of select="$tq:input/tq:error"/>
>> </xsl:message>
>> </xsl:when>
>> <xsl:otherwise>
>> <xsl:copy-of select="$tq:input//purchaseOrder[paid='yes']"/>
>> </xsl:otherwise>
>> </xsl:choose>
>> </xsl:template>

>></xsl:stylesheet>

>>This might not be what you had in mind, but I know I don't like it.

Evan



This archive was generated by hypermail 2.1.4 : Fri Feb 22 2002 - 11:35:58 CET