Skip to content

Commit b82298e

Browse files
committed
[bugfix] Don't allow xs:string to be cast as xs:QName.
Fix #3390
1 parent cf2e17a commit b82298e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

exist-core/src/main/java/org/exist/xquery/value/StringValue.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,6 @@ public AtomicValue convertTo(int requiredType) throws XPathException {
512512
return new GMonthDayValue(value);
513513
case Type.UNTYPED_ATOMIC:
514514
return new UntypedAtomicValue(getStringValue());
515-
case Type.QNAME:
516-
return new QNameValue(null, new QName(value, XMLConstants.NULL_NS_URI));
517515
default:
518516
throw new XPathException(ErrorCodes.FORG0001, "cannot cast '" +
519517
Type.getTypeName(this.getItemType()) + "(\"" + getStringValue() + "\")' to " +
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
xquery version "3.1";
2+
3+
module namespace t="http://exist-db.org/xquery/test";
4+
5+
declare namespace test="http://exist-db.org/xquery/xqsuite";
6+
7+
declare
8+
%test:assertFalse
9+
function t:castable-test() {
10+
"0" castable as xs:QName
11+
};

0 commit comments

Comments
 (0)