{"action":"created","issue":{"url":"https://api.github.com/repos/TEIC/TEI/issues/1330","labels_url":"https://api.github.com/repos/TEIC/TEI/issues/1330/labels{/name}","comments_url":"https://api.github.com/repos/TEIC/TEI/issues/1330/comments","events_url":"https://api.github.com/repos/TEIC/TEI/issues/1330/events","html_url":"https://github.com/TEIC/TEI/issues/1330","id":109543665,"number":1330,"title":"Specification for @match in att.scoping is confusing","user":{"login":"TEITechnicalCouncil","id":13886727,"avatar_url":"https://avatars.githubusercontent.com/u/13886727?v=3","gravatar_id":"","url":"https://api.github.com/users/TEITechnicalCouncil","html_url":"https://github.com/TEITechnicalCouncil","followers_url":"https://api.github.com/users/TEITechnicalCouncil/followers","following_url":"https://api.github.com/users/TEITechnicalCouncil/following{/other_user}","gists_url":"https://api.github.com/users/TEITechnicalCouncil/gists{/gist_id}","starred_url":"https://api.github.com/users/TEITechnicalCouncil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEITechnicalCouncil/subscriptions","organizations_url":"https://api.github.com/users/TEITechnicalCouncil/orgs","repos_url":"https://api.github.com/users/TEITechnicalCouncil/repos","events_url":"https://api.github.com/users/TEITechnicalCouncil/events{/privacy}","received_events_url":"https://api.github.com/users/TEITechnicalCouncil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TEIC/TEI/labels/AMBER","name":"AMBER","color":"fbca04"},{"url":"https://api.github.com/repos/TEIC/TEI/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/TEIC/TEI/labels/sf-automigrated","name":"sf-automigrated","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"stefaniegehrke","id":6319376,"avatar_url":"https://avatars.githubusercontent.com/u/6319376?v=3","gravatar_id":"","url":"https://api.github.com/users/stefaniegehrke","html_url":"https://github.com/stefaniegehrke","followers_url":"https://api.github.com/users/stefaniegehrke/followers","following_url":"https://api.github.com/users/stefaniegehrke/following{/other_user}","gists_url":"https://api.github.com/users/stefaniegehrke/gists{/gist_id}","starred_url":"https://api.github.com/users/stefaniegehrke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefaniegehrke/subscriptions","organizations_url":"https://api.github.com/users/stefaniegehrke/orgs","repos_url":"https://api.github.com/users/stefaniegehrke/repos","events_url":"https://api.github.com/users/stefaniegehrke/events{/privacy}","received_events_url":"https://api.github.com/users/stefaniegehrke/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-05-31T15:49:02Z","updated_at":"2015-10-23T10:02:31Z","closed_at":null,"body":"The definition of `@match` in att.scoping says this:\r\n\r\n>supplies an arbitrary XPath expression using the syntax defined in Kay (ed.) (2007) which identifies a set of nodes, selected within the context identified by the target attribute if this is supplied, or within the context of the element bearing this attribute if it is not.\r\n\r\nwhereas the remark at the bottom says this:\r\n\r\n>The expression of certainty applies to the nodeset identified by the value of the target attribute, possibly modified additionally by the value of the match attribute. If neither attribute is present, the expression of certainty applies to the context of the certainty element itself, i.e. its parent element.\r\n\r\nThe one seems to mean that `<certainty>` (for instance) is the default XPath context, while the other means that `<certainty>`'s parent is the default context. But in fact it's more subtly confusing than that; the one refers to the `@match` attribute, while the other refers to the expression of uncertainty itself. This is such a potential source of error that I think it needs to be reviewed, and it should also be illustrated with more examples. Finally, I think we should strongly suggest that `@target` be used, to avoid this concern.\n\nOriginal comment by: @martindholmes"},"comment":{"url":"https://api.github.com/repos/TEIC/TEI/issues/comments/150533102","html_url":"https://github.com/TEIC/TEI/issues/1330#issuecomment-150533102","issue_url":"https://api.github.com/repos/TEIC/TEI/issues/1330","id":150533102,"user":{"login":"frederik-elwert","id":3049661,"avatar_url":"https://avatars.githubusercontent.com/u/3049661?v=3","gravatar_id":"","url":"https://api.github.com/users/frederik-elwert","html_url":"https://github.com/frederik-elwert","followers_url":"https://api.github.com/users/frederik-elwert/followers","following_url":"https://api.github.com/users/frederik-elwert/following{/other_user}","gists_url":"https://api.github.com/users/frederik-elwert/gists{/gist_id}","starred_url":"https://api.github.com/users/frederik-elwert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederik-elwert/subscriptions","organizations_url":"https://api.github.com/users/frederik-elwert/orgs","repos_url":"https://api.github.com/users/frederik-elwert/repos","events_url":"https://api.github.com/users/frederik-elwert/events{/privacy}","received_events_url":"https://api.github.com/users/frederik-elwert/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T10:02:31Z","updated_at":"2015-10-23T10:02:31Z","body":"I am afraid currently the guidelines contradict themselves. Especially, the [prose text](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/CE.html) and the examples contained therein are not in line with the definition in att.scoping.\r\n\r\nExamples in the prose text:\r\n\r\n    <div>\r\n     <certainty locus=\"name\" degree=\"0.3\"\r\n      match=\".//persName\"/>\r\n    </div>\r\n\r\nor\r\n\r\n    <u who=\"#A\">Have you heard the election results?<certainty\r\n      match=\"@who\" locus=\"value\"\r\n      degree=\"0.5\"/>\r\n    </u>\r\n\r\nVersus example in the definition:\r\n\r\n    <gap reason=\"cancelled\">\r\n     <certainty match=\"parent::gap/@reason\"\r\n      locus=\"value\" cert=\"low\"/>\r\n    </gap>\r\n\r\nThere are four possible cases, three of which are quite clear I think:\r\n\r\n1. Both `@target` and `@match` are given. Then `@target` selects an element, and the XPath expression in `@match` is evaluated in the context of that element.\r\n2. Neither are given. Then the `<certainty>` element refers to its parent.\r\n3. Only `@target` is given. Then the `<certainty>` element refers to the selected element.\r\n4. Only `@match` is given. This case is problematic, since there are two interpretations: The prose text of the guidelines assumes that then the XPath expression is evaluated in the context of the *parent* of `<certainty>`, while the definition in att.scoping states that it is evaluated in the context of `<certainty>` itself.\r\n\r\nI think that it is necessary to align the prose text and the definition. I will make an argument why I think the prose text is correct and the definition should be updated:\r\n\r\nIf neither `@target` nor `@match` are given, `<certainty>` refers to its parent. This could be interpreted as `@match=\"..\"`. But if we assume that `@match` has an implicit default value of \"..\", then this can only be true of `@target` is empty, otherwise we would implicitly select the parent of any element selected via `@target`. To me, the idea that the default value of `@match` changes from \"`..`\" to \"`.`\" when `@target` is not empty seems counter-intuitive.\r\n\r\nHowever, the fact that `<certainty>` refers to its parent when both `@target` and `@match` are absent could also be interpreted as `@target` having a default value of the parent element, i.e. \"`#xpath(..)`\". Then, the default value for `@match` would always be \"`.`\". When `@target` is given, `@match` is evaluated in the context of the selected element, when `@target` is absent, `@match` is evaluated in the context of the parent element.\r\n\r\nIn this interpretation, the examples in the prose text of the guidelines would be correct, while the definition would have to be updated. And to me, the examples in the text look much more natural than the `parent::*`-style examples in the definition."}}