Skip to content

Commit d877da7

Browse files
chris-evolvedbinaryadamretter
authored andcommitted
[bugfix] Change the cardinality of the xml-to-json options function argument
1 parent 69b871e commit d877da7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exist-core/src/main/java/org/exist/xquery/functions/fn/FunXmlToJson.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class FunXmlToJson extends BasicFunction {
4848

4949
private static final String FS_XML_TO_JSON_NAME = "xml-to-json";
5050
private static final FunctionParameterSequenceType FS_XML_TO_JSON_OPT_PARAM_NODE = optParam("node", Type.NODE, "The input node");
51-
private static final FunctionParameterSequenceType FS_XML_TO_JSON_OPT_PARAM_OPTIONS = optParam("options", Type.MAP, "The options map");
51+
private static final FunctionParameterSequenceType FS_XML_TO_JSON_OPT_PARAM_OPTIONS = param("options", Type.MAP, "The options map");
5252
static final FunctionSignature[] FS_XML_TO_JSON = functionSignatures(
5353
new QName(FS_XML_TO_JSON_NAME, Function.BUILTIN_FUNCTION_NS),
5454
"Converts an XML tree (in w3c 'XML Representation of JSON' format) into a string conforming to the JSON grammar. Basic string (un)escaping.",
@@ -67,7 +67,7 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro
6767
final Sequence result;
6868
final Sequence seq = (getArgumentCount() > 0) ? args[0] : Sequence.EMPTY_SEQUENCE;
6969
//TODO: implement handling of options
70-
final MapType options = (getArgumentCount() > 1) ? (MapType) args[1].itemAt(0) : new MapType(this, context);
70+
final MapType options = (getArgumentCount() == 2) ? (MapType) args[1].itemAt(0) : new MapType(this, context);
7171

7272
if (seq.isEmpty()) {
7373
result = Sequence.EMPTY_SEQUENCE;

0 commit comments

Comments
 (0)