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 issue 547 (Schematron ignores context select) and 548 (Schematron ignores AVT) #549

Merged
merged 1,266 commits into from
Jul 20, 2019

Conversation

AirQuick
Copy link
Member

This pull request derives from #546. So needs to be handled after that.


Fixes #547
Fixes #548

The root cause of the problems is that in order to create a context document node, schut-to-xspec.xsl just copies child::node() to an external XML file and specifies the XML file as @href:

<xsl:template match="x:context[not(@href)][
parent::*/x:expect-assert | parent::*/x:expect-not-assert |
parent::*/x:expect-report | parent::*/x:expect-not-report |
parent::*/x:expect-valid | ancestor::x:description[@schematron] ]">
<xsl:variable name="file" as="xs:anyURI" select="resolve-uri(
concat('context-', generate-id(), '.xml'),
concat($test-dir-uri, '/'))"/>
<xsl:result-document href="{$file}">
<xsl:copy-of select="./node()"/>
</xsl:result-document>
<xsl:element name="x:context">
<xsl:attribute name="href" select="$file"/>
</xsl:element>
</xsl:template>

This pull request fixes it by creating a document node on memory at run time.

As a bonus,

  • test-dir-uri parameter in schut-to-xspec.xsl is no longer necessary. xsl:param in schut-to-xspec.xsl and its related lines in CLI and Ant have been removed.
  • A pending test in test/schut-to-xspec.xspec is now activated.

# Conflicts:
#	test/generate-tests-utils.xspec
#	test/generate-x-utils.xspec
# Conflicts:
#	test/generate-tests-utils.xspec
#	test/generate-x-utils.xspec
# Conflicts:
#	test/generate-tests-utils.xspec
#	test/generate-x-utils.xspec
# Conflicts:
#	test/end-to-end/cases/expected/stylesheet/xspec-three-dots-result.html
# Conflicts:
#	src/compiler/generate-xspec-tests.xsl
# Conflicts:
#	test/win-bats/collection.xml
#	test/xspec.bats
# Conflicts:
#	test/win-bats/collection.xml
#	test/xspec.bats
# Conflicts:
#	test/xspec-308.xspec
#	test/xspec-node-selection.xspec
# Conflicts:
#	src/compiler/generate-tests-utils.xsl
# Conflicts:
#	src/compiler/generate-xspec-tests.xsl
# Conflicts:
#	test/end-to-end/cases/expected/stylesheet/xspec-three-dots-result.html
# Conflicts:
#	test/end-to-end/cases/expected/stylesheet/xspec-450-451-result.html
# Conflicts:
#	src/reporter/format-xspec-report.xsl
#	test/end-to-end/cases/expected/stylesheet/xspec-serialize-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-three-dots-result.html
…nario-block

# Conflicts:
#	src/reporter/format-xspec-report.xsl
#	test/end-to-end/cases/expected/query/xspec-153-result.html
#	test/end-to-end/cases/expected/query/xspec-177-result.html
#	test/end-to-end/cases/expected/query/xspec-346-result.html
#	test/end-to-end/cases/expected/query/xspec-452-result.html
#	test/end-to-end/cases/expected/query/xspec-467-result.html
#	test/end-to-end/cases/expected/query/xspec-67-result.html
#	test/end-to-end/cases/expected/query/xspec-ambiguous-expect-result.html
#	test/end-to-end/cases/expected/query/xspec-focus-1-result.html
#	test/end-to-end/cases/expected/query/xspec-function-result.html
#	test/end-to-end/cases/expected/query/xspec-import-result.html
#	test/end-to-end/cases/expected/query/xspec-imported-result.html
#	test/end-to-end/cases/expected/query/xspec-pending-result.html
#	test/end-to-end/cases/expected/query/xspec-report-result.html
#	test/end-to-end/cases/expected/query/xspec-serialize-result.html
#	test/end-to-end/cases/expected/query/xspec-three-dots-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-151-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-153-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-177-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-23_2-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-346-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-452-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-467-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-50-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-528-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-55-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-67-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-ambiguous-expect-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-focus-1-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-function-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-import-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-imported-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-pending-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-report-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-result-naming-collision-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-rule-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-serialize-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-three-dots-result.html
#	test/end-to-end/cases/expected/stylesheet/xspec-xslt2-result.html
@AirQuick AirQuick merged commit 96711ed into xspec:master Jul 20, 2019
@AirQuick AirQuick deleted the fix_issue-547-548 branch July 20, 2019 15:46
@AirQuick
Copy link
Member Author

@cirulls
Merged this bug fix.

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.

Schematron ignores AVT Schematron ignores x:context/attribute(select)
1 participant