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

Unused variables in teiodds.xsl break the transformation with Saxon 9.7.0.10 #190

Closed
AlexJitianu opened this issue Nov 22, 2016 · 13 comments
Labels
priority: releaseBlocker All tickets with this priority must be cleared in advance of the freeze before a release. resp: council type: bug A bug report.

Comments

@AlexJitianu
Copy link

Hello,

We are currently working on integrating Saxon 9.7 into OxygenXML and during this process we are also executing TEI transformations with this version of Saxon. We stumbled into the following issue. We have an "TEI ODD XHTML" transformation that cascades a couple of XSLTs over the ODD:

  1. odds/odd2odd.xsl
  2. odds/odd2lite.xsl
  3. html/html.xsl

The problem manifests itself on step 2 when the transformation fails with the following exception in teiodds.xsl, line 1168:

XTTE0570: An empty sequence is not allowed as the value of variable $max

Inside this teiodds.xsl there are a lot of variable declarations like this:

<xsl:variable name="max" select="@maxOccurs" as="xs:integer"/>

From what I've seen, the @maxOccurs attribute is not present on those context elements so Saxon is correct in reporting the error. On the other hand these variables are never used so perhaps you should remove them altogether. Saxon 9.7 probably started evaluating also these variables that are never used. Not necessarily a good thing...

We are using the stylesheet from version 7.41.0 but I see these variables on the latest version too:
https://github.com/TEIC/Stylesheets/blob/dev/odds/teiodds.xsl

@martindholmes
Copy link
Contributor

I think Syd is working on this particular code right now. But there's a broader issue that we could address.

The TEI and Stylesheets repos both contain saxon 9.5.1.5J, while my Jenkins box has 9.4.0.4J. If there's no urgency here, I think it would be a good idea for us to update the repos to include use 9.7, and then make sure the build process is also using what's in the repos (I'm not sure if it does, or whether it just uses the default on the system). If we make that switch, I'm sure we'll find a bunch of things like this that we can fix.

@martindholmes
Copy link
Contributor

Just checked: the build process in both cases uses the version of saxon which is in the repo, so a simple switch would presumably raise these issues directly in our build process.

What does Council think about updating Saxon in the repos?

@hcayless
Copy link
Member

I'm in favor, even if it means revealing bugs that force us to push back our "freeze" date.

@martindholmes
Copy link
Contributor

@hcayless could you run it by Council? It's something that's easy to revert if it reveals a thousand niggles that can't be dealt with till after the release.

@lb42
Copy link
Member

lb42 commented Nov 22, 2016

Irrespective of updating Saxon, surely the bug Alex indicates should be fixed in teiodds.xsl anyway?

@hcayless
Copy link
Member

Yes indeed. I've removed the unused variables. Will push the change as soon
as the current build on Jenkins is finished

On Tue, Nov 22, 2016 at 12:15 PM, Lou notifications@github.com wrote:

Irrespective of updating Saxon, surely the bug Alex indicates should be
fixed in teiodds.xsl anyway?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#190 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABbxS2TNVvXktCS2XVnTLYm_F3NKD9Fks5rAyNOgaJpZM4K5PGG
.

@jamescummings
Copy link
Member

Update the Saxon to expose any other problems

@martindholmes
Copy link
Contributor

martindholmes commented Nov 23, 2016

I've hit a similar bug with Oxygen 18.1 (Saxon 9.6), from odds/odd2relax.xsl line 716:

<xsl:variable name="max" select="@maxOccurs" as="xs:integer"/>

For one thing, this needs a default value of 1; for another, @maxOccurs can contain the string "unbounded", so the @as attribute will screw it up. This seems to fix it:

<xsl:variable name="max" select="if (@maxOccurs) then @maxOccurs else 1"/>

Shout out to @sydb, since he's working on this code: this bug is triggered on an ODD of mine in the current bleeding-edge Oxygen plugin, so I don't believe the next release can go out without its being fixed.

@sydb
Copy link
Member

sydb commented Nov 29, 2016

Can you guys test to see if this bug still occurs for you using the sydb-occurs2 branch?

@sydb
Copy link
Member

sydb commented Nov 29, 2016

NB TEI/1544 (I don’t know how to make that a real reference, like @martindholmes did above to #194 , which is now closed as TEI/1544 supersedes it.)

@martindholmes martindholmes added the priority: releaseBlocker All tickets with this priority must be cleared in advance of the freeze before a release. label Dec 2, 2016
@martindholmes
Copy link
Contributor

This really is a release blocker. The Oxygen plugin will fail to build RNG schemas unless this is fixed. I have a real-world schema which fails to build; #&(^(&W^_$ GitHub will not let me attach it, so please ask. It's the processing of the processedodd file that fails, with

/home/mholmes/WorkData/english/VictorianPoetryNetwork/svnrepo/utilities/buildODD.xml:53: The following error occurred while executing this line:
/home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___jenkins.tei_c.org_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/common/teianttasks.xml:349: java.lang.IllegalStateException: *** Internal Saxon error: local variable encountered whose binding has been deleted

@lb42
Copy link
Member

lb42 commented Dec 3, 2016

I installed latest versions of saxon and trang, and yes, there are things to fix. See TEIC/TEI#1547

@hcayless
Copy link
Member

hcayless commented Dec 5, 2016

Upgraded to latest Saxon (9.7.14) and fixed the ensuing bugs in 8022ebc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: releaseBlocker All tickets with this priority must be cleared in advance of the freeze before a release. resp: council type: bug A bug report.
Projects
None yet
Development

No branches or pull requests

6 participants