Menu

#749 fatal bug in 2.8.0 apropos att.global.rendition

AMBER
closed-fixed
None
5(default)
2015-05-29
2015-04-14
No

I am afraid the <classSpec> at.global.rendition is missing the vital attribute predeclare="true". I have committed the appropriate change to fix it.

This means that any ODD which redefines @rend, @rendition etc is going to fail when it comes to making a DTD. You may now formally curse the day DTDs were invented.

I might note that a few existing ODD users are going to be mighty confused when they find their code to change @rend globally simply fails to work these days. In retrospect, it would have been good to highlight this in the release notes.

Discussion

  • Martin Holmes

    Martin Holmes - 2015-04-14

    I've written to Council to ask if we need a 2.8.1 release to fix this. Presumably we do. We should also put a test in place to catch this in future; I worked with the 2.8 codebase for months before the release using @rendition and never had a problem, but of course I wouldn't touch a DTD with a barge pole.

    How would we catch this in a test?

     
    • Sebastian Rahtz

      Sebastian Rahtz - 2015-04-14

      On 14 Apr 2015, at 18:38, Martin Holmes martindholmes@users.sf.net wrote:

      I've written to Council to ask if we need a 2.8.1 release to fix this. Presumably we do.

      I’d say so, annoying as it is. maybe it should be 2.9.0

      We should also put a test in place to catch this in future; I worked with the 2.8 codebase for months before the release using @rendition and never had a problem, but of course I wouldn't touch a DTD with a barge pole.

      :-}

      How would we catch this in a test?
      just delete @style from at.global.rendition

      you might like to test this, to check my logic

      Sebastian Rahtz
      Chief Data Architect
      University of Oxford IT Services
      13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431

       
  • Martin Holmes

    Martin Holmes - 2015-04-14

    Just testing this, it doesn't seem to cause a problem for me. First, create a simple ODD:

    <TEI 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="myTEI">
               <moduleRef key="tei"></moduleRef>
               <moduleRef key="header"></moduleRef>
               <moduleRef key="core"></moduleRef>
               <moduleRef key="textstructure"></moduleRef>
               </classSpec>
          </schemaSpec>
          </body>
      </text>
    </TEI>
    

    Generate a DTD, create a simple instance doc which uses @style, validate: all OK.

    Then change the ODD to delete the @style:

    <TEI 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="myTEI">
               <moduleRef key="tei"></moduleRef>
               <moduleRef key="header"></moduleRef>
               <moduleRef key="core"></moduleRef>
               <moduleRef key="textstructure"></moduleRef>
    
               <classSpec type="atts" ident="att.global.rendition" mode="change">
                 <attList>
                   <attDef ident="style" mode="delete"/>
                 </attList>
               </classSpec>
          </schemaSpec>
          </body>
      </text>
    </TEI>
    

    Generate DTD, validate document again: @style is now not allowed. Delete @style and validate again: all good.

    What am I missing?

     

    Last edit: Martin Holmes 2015-04-14
    • Sebastian Rahtz

      Sebastian Rahtz - 2015-04-14

      ah. maybe this isn’t so bad. it breaks if you do the schemaSpec below, but you may argue that this is bad anyway.

      <schemaSpec ident="myTEI">
      <moduleRef key="tei"></moduleRef>
      <moduleRef key="header"></moduleRef>
      <moduleRef key="core"></moduleRef>
      <moduleRef key="textstructure"></moduleRef>
      <classRef key="att.global.analytic"/>
      <classRef key="att.global.rendition"/>
      <classSpec type="atts" ident="att.global.rendition" mode="change">
      <attList>
      <attDef ident="rendition" mode="change">
      <valList mode="add" type="semi">
      <valItem ident="a"/>
      </valList>
      </attDef>
      </attList>
      </classSpec>
      </schemaSpec>
      --
      Sebastian Rahtz
      Chief Data Architect
      University of Oxford IT Services
      13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431

       
  • Martin Holmes

    Martin Holmes - 2015-04-14

    You're right that in the case below, the valList is ignored:

    <TEI 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="myTEI">
               <moduleRef key="tei"></moduleRef>
               <moduleRef key="header"></moduleRef>
               <moduleRef key="core"></moduleRef>
               <moduleRef key="textstructure"></moduleRef>
    
               <classSpec type="atts" ident="att.global.rendition" mode="change">
                 <attList>
                   <attDef ident="rendition" mode="change">
                     <valList mode="add" type="semi">
                       <valItem ident="a"/>
                     </valList>
                   </attDef>
                 </attList>
               </classSpec>
          </schemaSpec>
          </body>
      </text>
    </TEI>
    

    DTD generates OK, file validates OK, @rendition is available. The only thing missing is the valList, so for instance Oxygen won't suggest "a" to you. This only affects DTDs.

    This doesn't seem disastrous, but it does need fixing. Let me test again when I have a chance to update my Oxygen plugin to incorporate your changes.

     
    • Sebastian Rahtz

      Sebastian Rahtz - 2015-04-14

      eh? I get

      foo.dtd:235: parser warning : PEReference: %att.global.rendition.attributes; not found
      %att.global.attribute.xmlspace;’>

      --
      Sebastian Rahtz
      Chief Data Architect
      University of Oxford IT Services
      13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431

       
  • Martin Holmes

    Martin Holmes - 2015-04-14

    Your update (rev 13206) doesn't seem to change anything in the test case; the generated DTD still doesn't reference the valList item at all.

    &lt;!--
    DTD generated from ODD source 2015-04-14T12:36:12Z. .
    TEI Edition: Version 2.8.1a. Last updated on
        14th April 2015, revision 13206
    TEI Edition Location: http://www.tei-c.org/Vault/P5/Version 2.8.1a./
    
    -->
    [...]
    
    &lt;!-- predeclared classes -->
    
    [...]
    
    &lt;!ENTITY % att.global.rendition.attribute.rend '
    rend CDATA  #IMPLIED'>
    
    &lt;!ENTITY % att.global.rendition.attribute.style '
    style CDATA  #IMPLIED'>
    
    &lt;!ENTITY % att.global.rendition.attribute.rendition '
    rendition CDATA  #IMPLIED'>
    <!ENTITY % att.global.rendition.attributes '
     %att.global.rendition.attribute.rend;
     %att.global.rendition.attribute.style;
     %att.global.rendition.attribute.rendition;'> 
    
    [...]
    

    So I think something different might be at work here.

     

    Last edit: Martin Holmes 2015-04-14
  • Martin Holmes

    Martin Holmes - 2015-04-14

    My version of the ODD doesn't include your classRef elements; and I thought I didn't need to include classRef elements because the classSpecs come in automatically as part of the tei module?

     
    • Sebastian Rahtz

      Sebastian Rahtz - 2015-04-14

      On 14 Apr 2015, at 20:55, Martin Holmes martindholmes@users.sf.net wrote:

      My version of the ODD doesn't include your classRef elements; and I thought I didn't need to include classRef elements because the classSpecs come in automatically as part of the tei module?

      yes. there’s things going on in here I don’t quite understand myself, and I can’t decide if my ODD is simply a mistake
      or is uncovering a bug.

      but its not as fatal as I implied.

      Sebastian Rahtz
      Chief Data Architect
      University of Oxford IT Services
      13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431

       
  • Syd Bauman

    Syd Bauman - 2015-05-29
    • status: open --> closed-fixed
    • assigned_to: Sebastian Rahtz
     
  • Syd Bauman

    Syd Bauman - 2015-05-29

    SR has already fixed this (even if it wasn't all that bad).