Skip to content

Commit

Permalink
[bugfix] fn:parse-xml-fragment#1 should return a document-node() when…
Browse files Browse the repository at this point in the history
… there is an XML document that has a XML declaration
  • Loading branch information
adamretter committed Nov 28, 2024
1 parent 863fe85 commit 5799a74
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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("<?xml ")) {
xml = "<" + FRAGMENT_WRAPPER_NAME + ">" + xmlContent + "</" + FRAGMENT_WRAPPER_NAME + ">";
} else {
xml = xmlContent;
Expand Down

0 comments on commit 5799a74

Please sign in to comment.