RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.OPTION, key, 0); role.setErrorCode("XPTY0004"); actual = th.applyFunctionConversionRules( actual, required, role, ExplicitLocation.UNKNOWN_LOCATION);
RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.OPTION, nominalKey, 0); role.setErrorCode("XPTY0004"); actual = th.applyFunctionConversionRules( actual, required, role, ExplicitLocation.UNKNOWN_LOCATION);
converted = config.getTypeHierarchy().applyFunctionConversionRules( converted, required, role, ExplicitLocation.UNKNOWN_LOCATION);
Sequence<?> converted = th.applyFunctionConversionRules( map.get(key), requiredTypes.get(keyName), role, ExplicitLocation.UNKNOWN_LOCATION); result = result.addEntry(key, converted.materialize()); if (isParamNameSaxon(keyName)) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.OPTION, keyName, 0); Sequence<?> converted = th.applyFunctionConversionRules( map.get(key), requiredTypesSaxon.get(keyName), role, ExplicitLocation.UNKNOWN_LOCATION); result = result.addEntry(key, converted.materialize());
converted = config.getTypeHierarchy().applyFunctionConversionRules( converted, required, role, ExplicitLocation.UNKNOWN_LOCATION);
Sequence<?> converted = th.applyFunctionConversionRules( map.get(key), requiredTypes.get(keyName), role, ExplicitLocation.UNKNOWN_LOCATION); result = result.addEntry(key, converted.materialize()); if (isParamNameSaxon(keyName)) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.OPTION, keyName, 0); Sequence<?> converted = th.applyFunctionConversionRules( map.get(key), requiredTypesSaxon.get(keyName), role, ExplicitLocation.UNKNOWN_LOCATION); result = result.addEntry(key, converted.materialize());
RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.VARIABLE, qName.getDisplayName(), -1); Configuration config = context.getConfiguration(); val = config.getTypeHierarchy().applyFunctionConversionRules( val, requiredType, role, ExplicitLocation.UNKNOWN_LOCATION); } else {
RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.VARIABLE, qName.getDisplayName(), -1); Configuration config = context.getConfiguration(); val = config.getTypeHierarchy().applyFunctionConversionRules( val, requiredType, role, ExplicitLocation.UNKNOWN_LOCATION); } else {
private Sequence[] typeCheckFunctionArguments(UserFunction uf, XdmValue[] arguments) throws XPathException { Configuration config = processor.getUnderlyingConfiguration(); UserFunctionParameter[] params = uf.getParameterDefinitions(); GroundedValue<?>[] vr = (GroundedValue<?>[])new GroundedValue[arguments.length]; for (int i = 0; i < arguments.length; i++) { net.sf.saxon.value.SequenceType type = params[i].getRequiredType(); vr[i] = arguments[i].getUnderlyingValue(); if (!type.matches(vr[i], config.getTypeHierarchy())) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.FUNCTION, uf.getFunctionName().getDisplayName(), i); Sequence<?> converted = config.getTypeHierarchy().applyFunctionConversionRules(vr[i], type, role, ExplicitLocation.UNKNOWN_LOCATION); vr[i] = converted.materialize(); } } return vr; }
private Sequence[] typeCheckFunctionArguments(UserFunction uf, XdmValue[] arguments) throws XPathException { Configuration config = processor.getUnderlyingConfiguration(); UserFunctionParameter[] params = uf.getParameterDefinitions(); GroundedValue<?>[] vr = (GroundedValue<?>[])new GroundedValue[arguments.length]; for (int i = 0; i < arguments.length; i++) { net.sf.saxon.value.SequenceType type = params[i].getRequiredType(); vr[i] = arguments[i].getUnderlyingValue(); if (!type.matches(vr[i], config.getTypeHierarchy())) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.FUNCTION, uf.getFunctionName().getDisplayName(), i); Sequence<?> converted = config.getTypeHierarchy().applyFunctionConversionRules(vr[i], type, role, ExplicitLocation.UNKNOWN_LOCATION); vr[i] = converted.materialize(); } } return vr; }
if (!required.matches(val, th)) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.FUNCTION, "", i); val = th.applyFunctionConversionRules(val, required, role, ExplicitLocation.UNKNOWN_LOCATION); if (!required.matches(result, th)) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.FUNCTION_RESULT, "", 0); result = th.applyFunctionConversionRules(result.materialize(), required, role, ExplicitLocation.UNKNOWN_LOCATION);
if (!required.matches(val, th)) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.FUNCTION, "", i); val = th.applyFunctionConversionRules(val, required, role, ExplicitLocation.UNKNOWN_LOCATION); if (!required.matches(result, th)) { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.FUNCTION_RESULT, "", 0); result = th.applyFunctionConversionRules(result.materialize(), required, role, ExplicitLocation.UNKNOWN_LOCATION);
role = new RoleDiagnostic(RoleDiagnostic.FUNCTION, "fn:apply", i + 1); Sequence<?> converted = th.applyFunctionConversionRules( args.get(i), expected, role, ExplicitLocation.UNKNOWN_LOCATION); argArray[i] = converted.materialize(); return th.applyFunctionConversionRules( rawResult, fit.getResultType(), resultRole, ExplicitLocation.UNKNOWN_LOCATION);
role = new RoleDiagnostic(RoleDiagnostic.FUNCTION, "fn:apply", i + 1); Sequence<?> converted = th.applyFunctionConversionRules( args.get(i), expected, role, ExplicitLocation.UNKNOWN_LOCATION); argArray[i] = converted.materialize(); return th.applyFunctionConversionRules( rawResult, fit.getResultType(), resultRole, ExplicitLocation.UNKNOWN_LOCATION);
RoleDiagnostic role = new RoleDiagnostic( RoleDiagnostic.FUNCTION, function.getStructuredQName().getDisplayName(), i); vr[i] = th.applyFunctionConversionRules(vr[i], type, role, ExplicitLocation.UNKNOWN_LOCATION);
RoleDiagnostic role = new RoleDiagnostic( RoleDiagnostic.FUNCTION, function.getStructuredQName().getDisplayName(), i); vr[i] = th.applyFunctionConversionRules(vr[i], type, role, ExplicitLocation.UNKNOWN_LOCATION);
role.setErrorCode("XTDE0050"); TypeHierarchy th = getConfiguration().getTypeHierarchy(); Sequence<?> seq = th.applyFunctionConversionRules(value, requiredType, role, attLoc); value = seq.materialize(); try {
role.setErrorCode("XTDE0050"); TypeHierarchy th = getConfiguration().getTypeHierarchy(); Sequence<?> seq = th.applyFunctionConversionRules(value, requiredType, role, attLoc); value = seq.materialize(); try {