Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xslt): fix issue 746 (transform() crashes Code Coverage) #1227

Merged
merged 4 commits into from
Sep 14, 2020

Conversation

AirQuick
Copy link
Member

@AirQuick AirQuick commented Sep 6, 2020

Fixes #746

These are outside the scope of the fix:

  • Coverage report HTML when stylesheet-location points to another XSLT file
  • xsl:for-each/@saxon:threads

@AirQuick AirQuick added the bug label Sep 6, 2020
@AirQuick AirQuick added this to the v2.0 milestone Sep 6, 2020
@galtm galtm self-requested a review September 8, 2020 14:21
@galtm
Copy link
Member

galtm commented Sep 8, 2020

@AirQuick : I plan to review this by next Monday. I'll have to dig up the original situation that led me to #746, but I suspect that fixing only the case where stylesheet-location points to the same XSLT file is still a useful step forward.

@AirQuick
Copy link
Member Author

AirQuick commented Sep 9, 2020

Thanks, @galtm.
The fix will work even when stylesheet-location points to another stylesheet. However, the coverage reporter (src/reporter/coverage-report.xsl) will not able to find it.
coverage-report.xsl collects stylesheets only through xsl:include or xsl:import:

<xsl:variable name="imports" as="document-node()*"
select="document($stylesheets/*/(xsl:import|xsl:include)/@href)" />
<xsl:variable name="new-stylesheets" as="document-node()*"
select="$stylesheets | $imports" />

@galtm
Copy link
Member

galtm commented Sep 13, 2020

I see what you mean. For my purpose, not including the coverage of the other stylesheet in the HTML report is fine. (I can see data about the other stylesheet in the trace file (...-coverage.xml), so there could be a path toward including the other stylesheet's coverage in the HTML report if someone wanted that.)

Copy link
Member

@galtm galtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you for fixing this!

@AirQuick AirQuick merged commit 009ae29 into xspec:master Sep 14, 2020
@AirQuick AirQuick deleted the fix_issue-746 branch September 14, 2020 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code Coverage fails for XSLT that calls transform()
2 participants