TEIC / Stylesheets

TEI XSL Stylesheets
231 stars 124 forks source link

ODD translation to rng fails in Oxygen ant task #533

Closed sderrick closed 2 years ago

sderrick commented 2 years ago

Output of task

Buildfile: /home/scott/.com.oxygenxml/extensions/v24.0/frameworks/http_www.tei_c.org_release_oxygen_updateSite.oxygen/tei/xml/tei/stylesheet/relaxng/build-to.xml

go: [echo] Do ODD expand processing (schema ${selectedSchema}) [xslt] Processing /home/scott/workspace/mbel-work/schemas/mbel.odd to /home/scott/workspace/mbel-work/schemas/mbel.odd.processedodd [xslt] Loading stylesheet /home/scott/.com.oxygenxml/extensions/v24.0/frameworks/http_www.tei_c.org_release_oxygen_updateSite.oxygen/tei/xml/tei/stylesheet/odds/odd2odd.xsl [echo] XSLT generate relaxng files [xslt] Processing /home/scott/workspace/mbel-work/schemas/mbel.odd.processedodd to /home/scott/workspace/mbel-work/schemas/out/mbel.rng [xslt] Loading stylesheet /home/scott/.com.oxygenxml/extensions/v24.0/frameworks/http_www.tei_c.org_release_oxygen_updateSite.oxygen/tei/xml/tei/stylesheet/profiles/default/relaxng/to.xsl

oddcleanup: [delete] Deleting: /home/scott/workspace/mbel-work/schemas/mbel.odd.processedodd

dist:

BUILD SUCCESSFUL Total time: 4 seconds

The process finished with exit code: 0

BUILD SUCCESSFUL Total time: 4 seconds

The process finished with exit code: 0

However the resulting rng file has an error in the text element "mbel_text" which has duplicate items all through it, the first is these

     <group> 
        <zeroOrMore>
           <ref name="mbel_model.global"/>
        </zeroOrMore>
        <choice>
           <ref name="mbel_body"/>
        </choice>
        <zeroOrMore>
           <ref name="mbel_model.global"/>
        </zeroOrMore>
        <optional>
           <group>
              <ref name="mbel_back"/>
              <zeroOrMore>
                 <ref name="mbel_model.global"/>
              </zeroOrMore>
           </group>
        </optional>
     </group>
     <zeroOrMore>
        <ref name="mbel_model.global"/>
     </zeroOrMore>
     <choice>
        <ref name="mbel_body"/>
        <zeroOrMore>
           <ref name="mbel_model.global"/>
        </zeroOrMore>
     </choice>

and these

    <ref name="mbel_att.global.attributes"/>
     <ref name="mbel_att.typed.attribute.subtype"/>
     <ref name="mbel_att.written.attributes"/>
     <ref name="mbel_att.global.attributes"/>
     <ref name="mbel_att.typed.attribute.subtype"/>
     <ref name="mbel_att.written.attributes"/>

there are more

The only thing I can find is that the text element mbel_text is referenced in the mbel_attr_constraint and the schema specification I am using the TEI addon from the TEI Technical Council.

I have attached the odd file and the resulting rng file.

mbel.odd.zip mbel.rng.zip

sydb commented 2 years ago

There are 2 <elementSpec>s for <text> with @mode=change in the ODD (one with module=textstructure on line 489, one without on line 827). The first one looks like it only changes the @type attribute; the second one allows for the MBEL-added <envelope> element to be in the content of <text>. They can be combined pretty easily into one, but seems to me it would be a good idea to convert this ODD to PureODD (i.e., to remove direct use of the RELAX NG language), and there are some other fixes to be made.

Since I was the original author of this customization (just over a decade ago), I took the liberty of actually making these changes. Since I no longer have access to the data (except for the sample files of a decade ago), I have not tested these changes, other than to see that they produce valid RELAX NG.

mbel.odd.zip

(I changed the title of the customization, but not the filename; in retrospect perhaps I should have.)

sderrick commented 2 years ago

Syd,

You are a scholar and a gentleman! Thank you for the fixes to our odd file.  Its been a long time since we communicated!  Yes it has been almost exactly 10 years since you drafted the original spec for Sherry!   I will pass on our talk and may sincere appreciation for taking the time to clean up the file.  I went over your changes and understand most but not all of them. I have looked for an extensive set of documentation with examples for ODD but have never found any?

The Papers project is moving along with over 3900 documents converted to TEI, a testament to you and your group as the founders of the project!

thanks again for the excellent help.

Scott Derrick

On 12/24/21 10:12 AM, Syd Bauman wrote:

There are 2 ||s for || with @.=change| in the ODD (one with |module=textstructure| on line 489, one without on line 827). The first one looks like it only changes the @.| attribute; the second one allows for the MBEL-added || element to be in the content of ||. They can be combined pretty easily into one, but seems to me it would be a good idea to convert this ODD to PureODD (i.e., to remove direct use of the RELAX NG language), and there are some other fixes to be made.

Since I was the original author of this customization (just over a decade ago), I took the liberty of actually making these changes. Since I no longer have access to the data (except for the sample files of a decade ago), I have not tested these changes, other than to see that they produce valid RELAX NG.

mbel.odd.zip https://github.com/TEIC/Stylesheets/files/7774980/mbel.odd.zip

(I changed the /title/ of the customization, but not the /filename/; in retrospect perhaps I should have.)

— Reply to this email directly, view it on GitHub https://github.com/TEIC/Stylesheets/issues/533#issuecomment-1000911246, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSE7FST4O4LKUWER3EDPLUSSZYTANCNFSM5KHBTFJA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>