acdh-oeaw / generic-dict-schema

A TEI Lex0 customization employed as the base model in several dictionaries produced at ACDH-CH
Creative Commons Attribution 4.0 International
0 stars 0 forks source link

cit constraint rules not working #6

Closed rausch-supola closed 1 month ago

rausch-supola commented 2 months ago

the first rule prevents the following rules from being invoked

rausch-supola commented 2 months ago

Could this affect the rule in usg context="tei:usg[not(@type = 'geographic') and not(@type='socioCultural')]" as well?

dasch124 commented 2 months ago

So, we have several contexts and one element in a document might be matching several rules, right?

So we could copy those rules which are now in tei:cit[not(@type = 'example')] to the other contexts - however, I feel duplicating the rules clutters the schema and makes it less readable.

Actually, I think, we have defined the same logic already in the <elementSpec> for <bibl> so probably we can remove it in the elementSpec for <cit>, couldn't we? For clarity we can leave an XML comment, for example.

rausch-supola commented 2 months ago

Actually, I started a pull request which solves the problem. It was a syntax error I guess: https://github.com/acdh-oeaw/generic-dict-schema/pull/7

<s:rule context="tei:cit/@type[not(. = 'example')]"> instead of <s:rule context="tei:cit[not(@type = 'example')]">

That's why I mentioned that maybe it concerns the rule in usg as well because it is the same syntax. - after a check it seems here the rule is working correctly. How is that possible?

There is no error message or anything, simply the rules are not applied

rausch-supola commented 2 months ago

Actually, I think, we have defined the same logic already in the <elementSpec> for <bibl> so probably we can remove it in the elementSpec for <cit>, couldn't we? For clarity we can leave an XML comment, for example.

I would go for this!

rausch-supola commented 1 month ago

I removed the first rule in cit as it is already included in the listBibl rule set (https://github.com/acdh-oeaw/generic-dict-schema/commit/9cfcf7378738c14c20486cb19e2940febdd9ee0f)