Really Small XML Durations
Brent Putman
putmanb at georgetown.edu
Wed Jun 7 18:10:28 EDT 2017
On 6/7/17 5:54 PM, Brent Putman wrote:
>
>
> As to whether the various libraries that we use actually parse and
> use that correctly, I can't confirm with certainty without going and
> looking and/or testing. But I would say that if you're doing it and
> it's now throwing an error, that's a good sign.
The relevant Java API is
javax.xml.datatype.DatatypeFactory#newDuration(String), which is just
the base class API. The docs say that:
* <p>The XML Schema specification states that values can be of an
arbitrary size.
* Implementations may chose not to or be incapable of supporting
arbitrarily large and/or small values.
* An {@link UnsupportedOperationException} will be thrown with a
message indicating implementation limits
* if implementation capacities are exceeded.</p>
Actual behavior will be determined by the actual Java runtime class
implementing that API .
So if you're not seeing an UOE being thrown, then either your Java
runtime's impl of that API supports the decimal sub-second precision,
or it's horribly broken.
Beyond that: the duration value generally gets converted by Shib
software to milliseconds (either a primitive long or java.lang.Long
type). The docs for
javax.xml.datatype.Duration#getTimeInMillis(Calendar) say:
* <p>If the seconds field carries more digits than milli-second order,
* those will be simply discarded (or in other words, rounded to zero.)
So be mindful of and avoid values smaller than PT0.001S or with more
decimal precision than 3 places.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20170607/9fca7a47/attachment.html>
More information about the users
mailing list