#457 ODD specs do not allow starting with non-TEI elements

closed-duplicate
nobody
None
5
2012-10-23
2012-10-23
No

= Summary =

If a user customizes TEI using an ODD specification so as to add non-TEI elements to the schema, then in cases where prefixes must be used it is not possible to have the schema start with a non-TEI element.

== Versions ==

Ubuntu 12.04.1

$ dpkg-query -W tei-roma
tei-roma 4.9

= Observations =

I have considered that maybe I was trying to do something which the ODD markup was simply not designed for. However, I found the following example

<schemaSpec prefix="TEI_" ident="testsvg" start="TEI svg">
<moduleRef key="header"/>
<moduleRef key="core"/>
<moduleRef key="tei"/>
<moduleRef key="textstructure"/>
<moduleRef url="svg11.rng"/>
</schemaSpec>

From the TEI P5 documentation at:

http://www.tei-c.org/release/doc/tei-p5-doc/en/html/TD.html#ST-aliens

So it seems the intent was to have the schemaSpec element be able to specify any random element known to the ODD instance. In the example above, the svg element.

At the same time, if prefixes are needed to prevent a name clash between TEI and non-TEI elements, the ODD markup is incapable of specifying a non-TEI starting element.

The following discussion makes use of the examples attached to this bug report. To follow, please:

1. Download the attached zip file.

2. Unzip.

3. Execute

$ make

Roma will be executed twice. The first run will finish without error. The second run will generate an error. This is the output when I run it:

$ make
roma test.xml
========= Roma starts at 2012-10-23 13:47:07 ===========
TEI stylesheet tree: /usr/share/xml/tei/stylesheet
Results to: RomaResults
Process test.xml to create testsvg1{.dtd|.xsd|.doc.xml|.rng|.rnc} in RomaResults
========= Roma version 4.9 starts execution at 2012-10-23 13:47:10.811061167 ===========
1. expand and simplify ODD
2. make RELAX NG from compiled ODD
3. make RELAX NG compact from XML
4. make XSD from RELAX NG
5. make DTD from compiled ODD
========= 2012-10-23 13:49:00.550826608 Roma ends
roma --schema=testsvg2 test.xml
========= Roma starts at 2012-10-23 13:49:00 ===========
TEI stylesheet tree: /usr/share/xml/tei/stylesheet
Results to: RomaResults
Process test.xml to create testsvg2{.dtd|.xsd|.doc.xml|.rng|.rnc} in RomaResults
========= Roma version 4.9 starts execution at 2012-10-23 13:49:00.703435150 ===========
1. expand and simplify ODD
2. make RELAX NG from compiled ODD
3. make RELAX NG compact from XML
4. make XSD from RELAX NG
/home/ldd/src/teibugs/teibug18/RomaResults/testsvg2.rng:8114:23: error: multiple definitions of "desc" without "combine" attribute
/home/ldd/src/teibugs/teibug18/RomaResults/testsvg2.rng:9124:24: error: multiple definitions of "title" without "combine" attribute
/home/ldd/src/teibugs/teibug18/RomaResults/testsvg2.rng:10678:23: error: multiple definitions of "text" without "combine" attribute

ERROR: trang fails.
This was a fatal error. 2012-10-23 13:49:16
5. make DTD from compiled ODD
========= 2012-10-23 13:49:21.652552818 Roma ends

The test.xml file contains two schemaSpec elements: testsvg1 and testsvg2. The first one replicates the example from the TEI P5 documentation, with the necessary changes to make it actually run without errors. The following line specifies that the schema should be allowed to start with TEI or with svg:

<schemaSpec prefix="TEI_" ident="testsvg1" start="TEI svg">

However the testsvg1.rng and rnc files specify that only TEI may start the document:

<start>
<choice>
<ref name="TEI_TEI"/>
</choice>
</start>

I believe this is because the "TEI_" prefix is used as follows:

1. It is added to all TEI elements and ONLY TEI elements.

2. It is added to both names in the start attribute.

3. roma tries to resolve TEI_TEI, finds a corresponding declaration. No problem. It is one possible start.

4. roma tries to resolve TEI_svg, finds no corresponding declaration (because of point 1 above), silently removes TEI_svg from possible starts.

5. roma produces the rng fragment shown above.

The second run of roma operates with the following declaration:

<schemaSpec ident="testsvg2" start="TEI svg">

This generates the proper start because there is no prefix and so all the names in the start attribute resolve without problem:

<start>
<choice>
<ref name="TEI"/>
<ref name="svg"/>
</choice>
</start>

However, it also generates errors because of name clashes between TEI and svg. In effect, the rng and rnc files are invalid.

Discussion

  • Louis-Dominique Dubeau

    • status: open --> open-duplicate
     
  • Louis-Dominique Dubeau

    Sorry, an error in browser nagivation led to filing a duplicate. (Thank you, Sourceforge, for not detecting duplicate transactions.)

     
  • Louis-Dominique Dubeau

    • status: open-duplicate --> closed-duplicate
     
  • Sebastian Rahtz

    Sebastian Rahtz - 2012-10-23

    I believe this is now solved, but Sourceforge Subversion is down, so I cannot check it in

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks