Hi Jorge,
- Is xs:decimal guaranteed to work across implementations according to the
spec, or can that also be limited by a range?
For details, I recommend you to have a direct look into the relevant specifications (e.g. [1]). Talking about the existing implementations (eXist, Saxon, Zorba, XQilla, etc.), afaik, they all provide a larger range for values of type xs:decimal.
- Is there a way to programmatically detect the range of xs:integer?
Not really. You’ll have to do arithmetics that exceed the usual limits for integer, long or double values, and check if errors like FOAR0002 are raised.
Hope this helps Christian