Project

Profile

Help

Bug #2771

closed

Xslt30Transformer#applyTemplates(Source source) always returns empty value if stylesheet has <xsl:result-document> element

Added by Anonymous over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2016-06-03
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Given:

<!-- test.xsl -->
<xsl:stylesheet version="3.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="a">
    <c>d</c>
  </xsl:template>

  <xsl:template match="whatever">
    <xsl:result-document href="out.xml">
      <e>f</e>
    </xsl:result-document>
  </xsl:template>

</xsl:stylesheet>

Then:

Xslt30Transformer transformer = compiler.compile(new StreamSource(new File("test.xsl"))).load30();
StreamSource source = new StreamSource(new StringReader("<a>b</a>"));
XdmValue xdmValue = transformer.applyTemplates(source);

Returns an empty value, even though I would expect it to return <c>d</c>@, because there's a template that matches the @<a> element.

If I remove the <xsl:result-document> element from the unmatched template, the code returns <c>d</c> as expected.

Is this a bug in Saxon or am I doing something wrong?

I attached a set of files you can test this with.


Files

saxon-result-document-issue.zip (822 Bytes) saxon-result-document-issue.zip Anonymous, 2016-06-03 12:16

Please register to edit this issue

Also available in: Atom PDF