#475 Stop using attributes to store space-delimited values


First time filing a feature request against TEI, so please be gentle.

Attributes should not be used to encode multiple, space-delimited values. This is a denormalized approach that should be reconsidered.

For example, the "@active", "@mutual", and "@passive" attributes of <relation> element accommodate "a list of identifier values for participant or participant groups". Burying such information in a space-delimited attribute value make it hard to extract, e.g. with XPath.

Instead, a child <ref> element or elements could be used to encode this information.


  • I see where you are coming from, but having a space-delimited list of tokens in attributes is fairly widespread. HTML does it, for example, as does SVG. So its not a private weirdness of TEI.

    In an ideal world, we could use child elements more; but this would be a fairly horrific backwardly-incompatible change, and I'd personally unconvinced its justified just on the argument that its slightly tedious to process.

    XPath does have the "tokenize()" function which can be used to break up these lists of values.

  • perhaps worth noting one way to to access this stuff in XPath/XSL.

    If our XML has <x y="1 2 3"/>
    then the XSL <xsl:if test="(tokenize(@y,' '))='2'">
    will check whether the value '2' is present.

    Unless I am going mad :-}

  • James Cummings
    James Cummings

    • assigned_to: James Cummings
    • Group: AMBER --> GREEN
  • James Cummings
    James Cummings

    Setting this as GREEN, since it seems there is nothing to do but close it. Just leaving open in case Council wishes to check. Otherwise will close after 2013-11 face-to-face Council meeting.

    • status: open --> closed-rejected
    • Piotr Banski
      Piotr Banski

      +1, and as a core XML mechanism to confirm this decision, cf. IDREFS.