-
Notifications
You must be signed in to change notification settings - Fork 31
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
Schematron: text() node fails #396
Comments
When I insert this pair of <x:description schematron="test.sch" xmlns:x="http://www.jenitennison.com/xslt/xspec">
<x:param name="only-child-elements">false</x:param>
<x:param name="visit-text">true</x:param>
<x:scenario focus="test this framework" label="above-mentioned">
... and run XSpec command line ( |
@shudson310 : does @AirQuick 's reply answer your question? Can we close the issue? |
The suggested params do fix the issue, but you may want to emphasize this in the documentation and tutorials. Thanks! You can close this issue. |
@vincentml I have such changes both for command line and Ant. |
Sorry to report, but I have tried all of these: Still getting errors reported in oXygen plugin. Not sure if it is an XSpec issue or a plugin issue. |
Both oXygen transformation scenario and plugin are Ant based. Parameters aren't implemented there yet. In the meantime, you have to modify Line 214 in 7361f19
|
Thanks for the tip! On OS X, this was in [Home]/Library/Preferences/com.oxygenxml/extensions/.../oxygen-results-view/build_report.xml After making this change and adding the parameters, the <x:expect-report> still fails. Are there any other files that still need to be modified? The expected diff still shows "()" instead of no content. |
After modification, your ...
<echo message=" STEP 3: Convert Schematron to XSL"/>
...
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="allow-foreign" expression="true"/>
<param name="only-child-elements" expression="false"/>
<param name="visit-text" expression="true"/>
<param name="phase" expression="${xspec.phase}" unless:blank="${xspec.phase}"/>
<xmlcatalog if:set="catalog">
... No other change was necessary on my end. |
It is better that XSpec itself should not override default parameter settings for Schematron, but users of XSpec can specify parameter settings for Schematron using However, it becomes more dicey when looking at the default values in different implementations of Schematron. The one in the GitHub Schematron project, which bundled with XSpec, is older. The one in oXygen is based on the one from GitHub and contains a number of enhancements. They have each different defaults.
It would be interesting to find out if the enhancements that oXygen has made to Schematron could be contributed to the GitHub Schematron project. This might be a question for @AlexJitianu What I think we can do for XSpec is to add more information in the wiki documentation about Schematron parameters. |
Thanks, @vincentml
|
That is a good observation. In the oXygen Preferences panel the defaults for |
Well, we usually create issues/pull request on the GitHub Schematron project with all the enhancements we consider worth making. We did the same with visit-text/only-child-elements parameters but, because we considered that the defaults should change, we didn't wait for the issues to reach a resolution and we made these changes in our distribution of Schematron. |
If To get it work, you seem to have to inject the following template into one of the stylesheets: <xsl:template match="text()" mode="schematron-select-full-path">
<xsl:apply-templates mode="#current" select="parent::element()"/>
<xsl:text>/text()[</xsl:text>
<xsl:value-of select="count(preceding-sibling::text()) + 1"/>
<xsl:text>]</xsl:text>
</xsl:template> Can you confirm it? What shall we do? |
I submitted #411. With it, Once the PR gets merged and ported to the oXygen XSpec plugin, Unfortunately the |
Just FYI. Using schxslt, |
I had not seen schxslt before. Very interesting! I will have to try using this Schematron implementation. |
I added a Wiki page, Testing Schematron with Text Nodes, based on this issue. |
I get a failure when a rule context is a text node: text(). For example:
If I change the rule to match the p element than the XSpec begins to work. I cannot change my .sch for many of my rules, so the XSpec framework should accommodate text() node matches.
The text was updated successfully, but these errors were encountered: