[xsl] Re: Any way to specify diagnostic message for missing stylesheet parameter?

Subject: [xsl] Re: Any way to specify diagnostic message for missing stylesheet parameter?
From: "Vladimir Nesterovsky vladimir@xxxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Oct 2014 13:38:25 -0000
You're right, required attribute should be omitted. But default value of
xsl:param will report desired warning or error message.
--
VB

-----Original Message-----
From: David Sewell [mailto:dsewell@xxxxxxxxxxxx] 
Sent: Thursday, October 16, 2014 4:14 PM
To: Vladimir Nesterovsky
Cc: 'xsl-list'
Subject: RE: Any way to specify diagnostic message for missing stylesheet
parameter?

The default parameter value is not possible when using <xsl:param
required="yes">. xsl:param must be empty in that case.

On Thu, 16 Oct 2014, Vladimir Nesterovsky wrote:

> You can define a default value of parameter in a way to report omission:
>
> <xsl:param name="somevar">
>  <xsl:sequence select="'default'"/>
>  <xsl:message select="somevar is not specified"/> </xsl:param>
> --
> VN
>
> -----Original Message-----
> From: David Sewell [mailto:dsewell@xxxxxxxxxxxx]
> Sent: Wednesday, October 15, 2014 7:19 PM
> To: xsl-list
> Subject: Any way to specify diagnostic message for missing stylesheet 
> parameter?
>
> Given a stylesheet parameter <xsl:param name="somevar" 
> required="yes"/>, failing to supply a parameter value at run-time 
> results in a boilerplate error message such as "XTDE0050: No value 
> supplied for required parameter somevar".
>
> It would be helpful to be able to supply a custom error message such 
> as
> "required: somevar=[true|false|unknown]" to save the user the time it 
> takes to look through the code to figure out what parameter is 
> expected. There's no way to do this in the XSLT spec through 3.0, 
> correct? and no common extensions for doing it?
>
> If not, would that be a useful feature for others, or are there 
> reasons not to implement something like that as an extension or
enhancement?
>
> David
>
> --
> David Sewell, Editorial and Technical Manager ROTUNDA, The University 
> of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA
> Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
> Web: http://rotunda.upress.virginia.edu/
>
>
>
>

--
David Sewell, Editorial and Technical Manager ROTUNDA, The University of
Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/

Current Thread