[tei-council] <content> vs <mixedContent>

Sebastian Rahtz sebastian.rahtz at it.ox.ac.uk
Sun Oct 5 13:52:40 EDT 2014


On 5 Oct 2014, at 18:28, Lou Burnard <lou.burnard at retired.ox.ac.uk> wrote:

> 
>> 
>> <mixedContent> is provided explicitly as a shortcut convenience for the common case, recognised in all  current schema languages and used in 99% of all TEI derived schemas,
>> I think this is not true, actually. Plain text is used in almost none of the TEI models.
>> Let me do some poking to see if I can derive the statistics.
> 
> That was not what I asserted! I asserted that *mixedContent* (in which rng:text alternates with other elements or classes of elements) appears in almost all TEI models.

if we take <p> as an example, its content is macro.paraContent, which expands to

    <rng:zeroOrMore xmlns:rng="http://relaxng.org/ns/structure/1.0">
      <rng:choice>
        <rng:text/>
        <rng:ref name="model.gLike"/>
        <rng:ref name="model.phrase"/>
        <rng:ref name="model.inter"/>
        <rng:ref name="model.global"/>
        <rng:ref name="lg"/>
      </rng:choice>
    </rng:zeroOrMore>

i.e. almost exactly what you expect <mixedContent> to do. HOWEVER, your naive ODDer would probably write this as

<mixedContent>
	<classRef key=“model.phrase”/>
	<classRef key=“model.inter”/>
	<elementRef key=“lg”/>
</mixedContent>

because they would concentrate on the classes and elements they understood, knowing the “mixed”-ness will be supplied
by the ODD processor, and thus losing the model.gLike which we recommend to everyone.

My point is that the behaviour exhibited by <mixedContent>, i.e. alternating <rng:text> with any element or class references which
are given, would represent the behaviour of just 6 existing TEI elements (code, constraint, creation, egXML, formula, zone). Therefore
I suggest that its apparent usefulness in our familiar TEI content is very limited.  That’s not to say that people writing ODD
for schemas in a simpler world would not use it (although the inability to distinguish string from token whitespaceness would
not find it friends in the XML Data community); but it would be unusual for us to add  a facility which we don’t use ourselves.

it is arguable that a <simpleContent>, which supplied a default <zeroOrMore><alternate> wrapper around the *Ref inside it,
would have far greater utility, in which the user can easily add a <macroRef> to data.text

--
Sebastian Rahtz      
Director (Research) of Academic IT
University of Oxford IT Services
13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431

Não sou nada.
Nunca serei nada.
Não posso querer ser nada.
À parte isso, tenho em mim todos os sonhos do mundo.



More information about the tei-council mailing list