You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// first sibling is either DEFAULT_DECIMAL_FORMAT (default) or EQNAME (named)
519
520
final XQueryAST dfName = (XQueryAST) root.getNextSibling();
520
521
522
+
final QName qnDfName;
523
+
if ("default".equals(dfName.getText())) {
524
+
qnDfName = XQueryContext.UNNAMED_DECIMAL_FORMAT;
525
+
if (hasDefaultDecimalFormat) {
526
+
throw new XPathException(dfName.getLine(), dfName.getColumn(), ErrorCodes.W3CErrorCode.XQST0111.getErrorCode(), "Query prolog cannot contain two default decimal format declarations.");
throw new XPathException(dfName.getLine(), dfName.getColumn(), ErrorCodes.XPST0081, "No namespace defined for prefix "+ dfName.getText());
535
+
}
536
+
537
+
if (staticContext.getStaticDecimalFormat(qnDfName) != null) {
538
+
throw new XPathException(dfName.getLine(), dfName.getColumn(), ErrorCodes.W3CErrorCode.XQST0111.getErrorCode(), "Query prolog cannot contain two decimal format declarations with the same name: "+ dfName.getText());
539
+
}
540
+
}
541
+
521
542
// position current at the first property name for the decimal format
522
543
XQueryAST current = (XQueryAST) dfName.getNextSibling();
throw new XPathException(dfName.getLine(), dfName.getColumn(), ErrorCodes.XPST0081, "No namespace defined for prefix "+ dfName.getText());
555
-
}
556
-
}
557
-
558
568
final DecimalFormat df = DecimalFormat.fromProperties(dfProperties);
559
569
if (!df.checkDistinctCharacters()) {
560
570
throw new XPathException(dfName.getLine(), dfName.getColumn(), ErrorCodes.W3CErrorCode.XQST0098.getErrorCode(), "Characters within the picture string of the decimal format: "+ dfName.getText() +" are not distinct.");
Copy file name to clipboardExpand all lines: exist-core/src/main/java/org/exist/xquery/ErrorCodes.java
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -224,6 +224,7 @@ public enum W3CErrorCode implements IErrorCode {
224
224
XQDY0101 ("An error is raised if a computed namespace constructor attempts to do any of the following: Bind the prefix xml to some namespace URI other than http://www.w3.org/XML/1998/namespace. Bind a prefix other than xml to the namespace URI http://www.w3.org/XML/1998/namespace. Bind the prefix xmlns to any namespace URI. Bind a prefix to the namespace URI http://www.w3.org/2000/xmlns/. Bind any prefix (including the empty prefix) to a zero-length namespace URI."),
225
225
XQDY0102 ("If the name of an element in an element constructor is in no namespace, creating a default namespace for that element using a computed namespace constructor is an error."),
226
226
XQST0103 ("All variables in a window clause must have distinct names."),
227
+
XQST0111 ("It is a static error for a query prolog to contain two decimal formats with the same name, or to contain two default decimal formats."),
227
228
XQDY0137 ("No two keys in a map may have the same key value"),
228
229
XQDY0138 ("Position n does not exist in this array"),
229
230
XUDY0023 ("It is a dynamic error if an insert, replace, or rename expression affects an element node by introducing a new namespace binding that conflicts with one of its existing namespace bindings."),
0 commit comments