Skip to content

Commit 0effcf3

Browse files
authored
Merge pull request #4439 from evolvedbinary/bugfix/qname-castable
2 parents bb77ff4 + 96c862e commit 0effcf3

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-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
@@ -514,8 +514,6 @@ public AtomicValue convertTo(int requiredType) throws XPathException {
514514
return new GMonthDayValue(value);
515515
case Type.UNTYPED_ATOMIC:
516516
return new UntypedAtomicValue(getStringValue());
517-
case Type.QNAME:
518-
return new QNameValue(null, new QName(value, XMLConstants.NULL_NS_URI));
519517
default:
520518
throw new XPathException(ErrorCodes.FORG0001, "cannot cast '" +
521519
Type.getTypeName(this.getItemType()) + "(\"" + getStringValue() + "\")' to " +
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(:
2+
: eXist-db Open Source Native XML Database
3+
: Copyright (C) 2001 The eXist-db Authors
4+
:
5+
6+
: http://www.exist-db.org
7+
:
8+
: This library is free software; you can redistribute it and/or
9+
: modify it under the terms of the GNU Lesser General Public
10+
: License as published by the Free Software Foundation; either
11+
: version 2.1 of the License, or (at your option) any later version.
12+
:
13+
: This library is distributed in the hope that it will be useful,
14+
: but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
: Lesser General Public License for more details.
17+
:
18+
: You should have received a copy of the GNU Lesser General Public
19+
: License along with this library; if not, write to the Free Software
20+
: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
:)
22+
(:~
23+
: @see https://github.com/eXist-db/exist/issues/3390
24+
:)
25+
xquery version "3.1";
26+
27+
module namespace t="http://exist-db.org/xquery/test";
28+
29+
declare namespace test="http://exist-db.org/xquery/xqsuite";
30+
31+
declare
32+
%test:assertFalse
33+
function t:castable-test() {
34+
"0" castable as xs:QName
35+
};

0 commit comments

Comments
 (0)