ajm324 / natalia

We will be analyzing Natalia Lafourcade's albums Musas Vols. 1 and 2 and Un Canto por Mexico Vol. 1 for their use of folk-inspired natural imagery in representing a connection to country and latinx identity.
0 stars 0 forks source link

Attributes, repetition, and mixed content #4

Closed djbpitt closed 3 years ago

djbpitt commented 3 years ago

https://github.com/ajm324/natalia/blob/05c14d1bb1574351f341e1d1d41e386ca3c44480/natalia-schema.rnc#L14

(The preceding is a reference to a line in your Relax NG schema. GitHub makes it possible to associate Issues with specific lines of code, so you can find the relevant line more easily.)

Your description of an <assoc> element as containing mixed content with @type and @image attributes will work, but you can make it more self-explanatory by rephrasing it. The issues are that:

  1. Attributes are not repeatable, but your content model uses an asterisk, which allows unlimited repetition.
  2. Attributes are not really mixed in with plain text the way that, for example, <assoc> and <place> elements can be mixed inside a <line>.

We'd suggest changing the line where you define <assoc> to:

assoc = element assoc { type?, image?, text }

This avoids saying that the attributes are repeatable, and by avoiding the keyword mixed it clarifies that the only thing allowed between the start- and end-tags of an <assoc> element is plain text.