TEIC / Stylesheets

TEI XSL Stylesheets
232 stars 124 forks source link

Error transforming compiled ODD to XHTML in oXygen #647

Closed dlschwartz closed 10 months ago

dlschwartz commented 10 months ago

With the update to Version 4.7.0 I get an error I never used to get. When converting a compiled ODD to XHTML using the "TEI P5 XHTML" transformation scenario in oXygen I get the following fatal error:

errorCompiledToHTML

I can use the same transformation scenario to generate XHTML from an ODD customization. I only get the error when trying to transform an ODD compiled using the "odd2odd" xslt.

raffazizzi commented 10 months ago

Hello @dlschwartz, this is indeed because of new code we have added in this release. You may be running into it if your compiled ODD ends up with more than one tei:desc[@xml:lang='en']/@versionDate or more than one tei:gloss[@xml:lang='en']/@versionDate in the same *Spec. There shouldn't be more than one desc per language, with the exception of desc[@type="deprecationInfo"].

I think this can also occur if you have more than one <elementSpec> with the same @ident. Could you check your ODDs for this potential scenario and report back?

If you can provide this information, it will help us determining whether we need to adjust the schematron to avoid duplications in the ODD, or if there is indeed a bug in the Stylesheets code.

dlschwartz commented 10 months ago

Thank @raffazizzi. I've checked my ODDs. None have more than one <elementSpec> with the same @ident.

However, my compiled ODDs have lots of tei:desc[@xml:lang='en']/@versionDate and tei:gloss[@xml:lang='en']/@versionDate. This is the case both on my old ODDs compiled using version 4.6.0 and the new ones compiled using 4.7.0.

Using 4.6.0 I can successfully transform into XHTML, but using 4.7.0 I get the error.

Thanks for looking into this!

sydb commented 10 months ago

This is a really interesting problem that we have managed to introduce, I suspect (without really looking), because we put the constraint that requires there be only 1 typeless <desc> (or <gloss>) with a given @xml:lang in p5odds and tei_customization, but we put the code that relies on that constraint in the general-purpose stylesheets. My instinct is that we need to just concede the fact that there may be more than one, and change the gt operator to the > operator.

But I am also a bit confused, @dlschwartz, becuase it looks to me like the code you are showing in the OP is 7.55.0, not 7.56.0.

sydb commented 10 months ago

Warning to @dlschwartz and @raffazizzi — I am going to try to transfer this issue to the Stylesheets repo.

sydb commented 10 months ago

@dlschwartz — If I asked nicely, would you be willing to share your ODD customization file which, when processed into a compiled ODD, caused this problem?

Because even though I have fixed the Stylesheets problem (I believe), it is still worth investigating what changed in 4.7.0 that caused multiple <desc>s and <gloss> elements with the same language. (I do not think it is just that you were using the 7.55.0 Stylesheets, but it might be.)

If you do not want to just attach it to this issue (which means ZIPping it or changing the extension, because last I knew GitHub rejects .xml, .tei, and .odd files), we can arrange some other transfer mechanism.

dlschwartz commented 10 months ago

Thanks @sydb. I can share my ODD. But I also get the same problem when working with a brand new ODD file as it comes out when generated by oXygen. Here's the entire ODD as oXygen creates it, I didn't make any changes:

<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg"
  xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns="http://www.tei-c.org/ns/1.0">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>Title</title>
      </titleStmt>
      <publicationStmt>
        <p>Publication Information</p>
      </publicationStmt>
      <sourceDesc>
        <p>Information about the source</p>
      </sourceDesc>
    </fileDesc>
  </teiHeader>
  <text>
    <body>
      <schemaSpec ident="oddex1" start="TEI">
        <moduleRef key="header"/>
        <moduleRef key="core"/>
        <moduleRef key="tei"/>
        <moduleRef key="textstructure"/>
      </schemaSpec>
    </body>
  </text>
</TEI>

Let me know if it would still help to have the ODD I first noticed the problem with. Thank you.

sydb commented 10 months ago

So far I have been unable to reproduce the problem. (I used roma2 --debug to convert the above ODD file to a compiled ODD, then ran the released version of Stylesheets/bin/teitohtml on that compiled ODD.) What process did you use? Oh, you used oXygen all the way, yes? Perhaps I will try that in a bit …

dlschwartz commented 10 months ago

@sydb, yes I use oXygen all the way. I went back this morning and double checked all of the stylesheet involved in the transformation. It turns out there were some files oXygen was using that I hadn't updated. I ensured all the the stylesheets were updated to 7.56.0 and it works as expected. I should have caught that earlier. Thank you for your help.

sydb commented 10 months ago

Whoo-hoo! Glad it all worked out.