Project

Profile

Help

Bug #6456

open

parse-xml-fragment() is not implemented in SaxonCS

Added by Michael Kay 25 days ago. Updated 25 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2024-06-21
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
12, trunk
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
.NET

Description

It seems that under SaxonCS, parse-xml-fragment() always returns an empty sequence.

Actions #1

Updated by Martin Honnen 25 days ago

For me, it seems implemented in 12.4 and certainly parses XML fragment:

PS C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\parse-xml-fragment> type .\sample1.xml
<root><![CDATA[This is a test with some <b>bold</b> text.]]></root>
PS C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\parse-xml-fragment> type .\parse-xml-fragment-test1.xq
parse-xml-fragment(.)
PS C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\parse-xml-fragment> & 'C:\Program Files\Saxonica\SaxonCS-12.4\SaxonCS.exe' query -s:.\sample1.xml -q:.\parse-xml-fragment-test1.xq
<?xml version="1.0" encoding="UTF-8"?>This is a test with some <b>bold</b> text.
Actions #2

Updated by Michael Kay 25 days ago

Ah, I see now what's happening. The class net.sf.saxon.functions.ParseXmlFragment.cs says:

public override Saxon.Hej.om.Sequence call(Saxon.Hej.expr.XPathContext context, Saxon.Hej.om.Sequence[] arguments) {
       return Saxon.Hej.value.EmptySequence.getInstance(); // TODO: implement me!
}

But XPath30FunctionSet.java in fact directs calls to a different class Saxon.Impl.Helpers.ParseXmlFragment. The problem only appeared (on the 13.x branch) when I tried to implement the new 4.0 2-argument form of the function without that redirection.

Please register to edit this issue

Also available in: Atom PDF