TEIC / Stylesheets

TEI XSL Stylesheets
231 stars 124 forks source link

Unable to properly delete a `<constraintSpec>` #541

Closed sydb closed 2 years ago

sydb commented 2 years ago

One would think this would be easy. Just <constraintSpec module="[module]" ident="[ident]" sceme="schematron" mode="delete"/> should do it, eh? A bit weird that @scheme is required, but no big deal.

No such luck. The big deal is that it does not work. Nor does most any other method I tried. According to my little test ODD (which is attached to this ticket with an extra .txt extension), one can delete a <constraintSpec> from a class by specifying the deletion or change (to an empty <constraintSpec> or <constraint>) in a <classSpec mode="change">; and one can delete a <constraintSpec> from an element only if "replace"ed with an empty one.

I do not think this is the right state of affairs. I think that the whole point of being in att.identifiable is to be deleted or over-ridden.

martindholmes commented 2 years ago

With @sydb @HelenaSabel and @npcole : We found that if we change line 2018 or odd2odd.xsl from:

<xsl:for-each select="tei:constraintSpec">

to:

<xsl:for-each select="descendant::tei:constraintSpec">

we get a change in behaviour -- processing does find the constraintSpecs -- but the original problem is not solved by this alone.

sydb commented 2 years ago

We (the Stylesheets group) have just discovered the problem (thanks to @HelenaSabel :-) — the key ../@ident||'_'||@ident does the wrong thing in some cases. So our proposed solution is to just use @ident instead. There are a few cases where this will fail, because we have used the same identifier on two or more <constraintSpec>s:

      5 abstractModel-structure-l
      3 spanTo
      3 spanTo_fr
      2 abstractModel-structure-p

So we suggest those 13 just get re-named, so we can use just @ident. This solution also requires that users always use unique constraintSpec/@ident, so probably a <constraintSpec> to enforce that is a good idea!

HelenaSabel commented 2 years ago

Blocked until the discussion on TEI ticket 2223 is closed.

sydb commented 2 years ago

See TEI issue 2223 and the corresponding PR.

Hmmm … is it better to write that as

See /TEIC/TEI/issues/2223 and the corresponding PR, /TEIC/TEI/pull/2224.

? The former looks nicer, but the latter gives you pop-ups.