-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fn:is-collation-available #1160
Comments
I assume that Given that we already have |
Yes
Yes |
I would suggest taking the collation URI as the argument; if they want to use the map form they can write
for example; and using the parameter name |
Sorry if this is off-topic, but I first misread the post as asking for Since calls to For reference, eXist has an implementation-specific |
Maybe |
@michaelhkay, if In the other possible case, when the call to Or maybe you meant something else? |
Yes, indeed, if the collation specifies But now I see your point. We have said that We could of course change the rules so that the |
And this bad end is exactly what the proposed fn:collation-available is design to avoid. One use case is when the developer has a list of possible collations - best, good, so-so - and the code checks for the availability of these collations in this order, and uses the first of the three collations that is available. |
Closed by virtue of PR #1262 |
The new function fn:collation raises an error [err:FOCH0002] in the case when the requested collation is not supported. Or, if the
fallback
key's value istrue()
, then the implementation chooses "the most similar supported collation" - which could be perceived as arbitrary and unexpected by the code developer.This might be OK if the language has try/catch capabilities and
fallback="no"
is specified, but may not be the best outcome in a pure XPath evaluation.A solution to this problem is to provide a function fn:is-collation-available that accepts the same argument (
$options
map) asfn:collation
, and also could accept a string argument whose value is the URI of the collation. This function produces a boolean,true()
meaning that the collation is available and can be constructed and used,false()
- otherwise.Signature
fn:is-collation-available( $descriptor as xs:string | map(*) ) as xs:boolean
The text was updated successfully, but these errors were encountered: