Samuel,
It is good practice to validate parameters and issue an appropriate
error or exception.
The function class that will be extended for XPath has the ability to
transmit
error messages back to the stylesheet transformation application.
Users and applications are known to put bad formatted data into strings.
We should be able to recognize and report the errors in a standard way.
There are already lots of standard messages in the library. If one is
appropriate,
it can be used. Otherwise we can create new message strings and add
them to the
library.
I will do some brief research and get back to you.
Sincerely,
Steven J. Hathaway
On 6/5/2012 9:15 AM, Samuel Medeiros wrote:
Steven,
I am finishing to implement the add function described at
http://www.exslt.org/date/functions/add/index.html.
It receives two strings: the date and the duration.
The date may be in the following formats:
* |xs:dateTime|
<http://www.w3.org/TR/xmlschema-2/#dateTime> (|CCYY-MM-DDThh:mm:ss|)
* |xs:date| <http://www.w3.org/TR/xmlschema-2/#date> (|CCYY-MM-DD|)
* |xs:gYearMonth|
<http://www.w3.org/TR/xmlschema-2/#gYearMonth> (|CCYY-MM|)
* |xs:gYear| <http://www.w3.org/TR/xmlschema-2/#gYear> (|CCYY|)
Do I need to verify or should I assume that they are in one of the
accepted formats?
For date parameter, for example, I would verify if the YY, MM and DD
are integers, MM is >0 e <= 12 and the day is valid in the pair YY-MM.
Sincerely,
Samuel Queiroz