Menu

#475 Stop using attributes to store space-delimited values

GREEN
closed-rejected
None
5(default)
2013-11-13
2013-10-08
aaronbauman
No

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.

Discussion

  • Sebastian Rahtz

    Sebastian Rahtz - 2013-10-08

    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.

     
  • Sebastian Rahtz

    Sebastian Rahtz - 2013-10-08

    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 - 2013-11-09
    • assigned_to: James Cummings
    • Group: AMBER --> GREEN
     
  • James Cummings

    James Cummings - 2013-11-09

    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.

     
  • Hugh A. Cayless

    Hugh A. Cayless - 2013-11-13
    • status: open --> closed-rejected
     
    • Piotr Banski

      Piotr Banski - 2013-11-13

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