From 5799a741ce7ca2321e084516d67575babcce7e2d Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Tue, 5 Sep 2023 00:25:06 +0200 Subject: [PATCH] [bugfix] fn:parse-xml-fragment#1 should return a document-node() when there is an XML document that has a XML declaration --- .../java/org/exist/xquery/functions/fn/ParsingFunctions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exist-core/src/main/java/org/exist/xquery/functions/fn/ParsingFunctions.java b/exist-core/src/main/java/org/exist/xquery/functions/fn/ParsingFunctions.java index 792a3e9704b..356df7ee98a 100644 --- a/exist-core/src/main/java/org/exist/xquery/functions/fn/ParsingFunctions.java +++ b/exist-core/src/main/java/org/exist/xquery/functions/fn/ParsingFunctions.java @@ -105,7 +105,7 @@ private Sequence parse(final String xmlContent, final Sequence[] args) throws XP private ValidationReport validate(final String xmlContent, final SAXAdapter saxAdapter) throws XPathException { final String xml; - if (isCalledAs("parse-xml-fragment")) { + if (isCalledAs("parse-xml-fragment") && !xmlContent.toLowerCase().startsWith("" + xmlContent + ""; } else { xml = xmlContent;