{"action":"created","issue":{"url":"https://api.github.com/repos/dita-ot/dita-ot/issues/2339","repository_url":"https://api.github.com/repos/dita-ot/dita-ot","labels_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/2339/labels{/name}","comments_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/2339/comments","events_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/2339/events","html_url":"https://github.com/dita-ot/dita-ot/issues/2339","id":153029133,"number":2339,"title":"@keyscope on the root <map> element causes builds to fail","user":{"login":"leighw","id":3180473,"avatar_url":"https://avatars.githubusercontent.com/u/3180473?v=3","gravatar_id":"","url":"https://api.github.com/users/leighw","html_url":"https://github.com/leighw","followers_url":"https://api.github.com/users/leighw/followers","following_url":"https://api.github.com/users/leighw/following{/other_user}","gists_url":"https://api.github.com/users/leighw/gists{/gist_id}","starred_url":"https://api.github.com/users/leighw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighw/subscriptions","organizations_url":"https://api.github.com/users/leighw/orgs","repos_url":"https://api.github.com/users/leighw/repos","events_url":"https://api.github.com/users/leighw/events{/privacy}","received_events_url":"https://api.github.com/users/leighw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dita-ot/dita-ot/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/dita-ot/dita-ot/labels/needs-reproduction","name":"needs-reproduction","color":"009800"},{"url":"https://api.github.com/repos/dita-ot/dita-ot/labels/preprocess/keyref","name":"preprocess/keyref","color":"84b6e8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-04T14:41:39Z","updated_at":"2016-05-04T14:58:29Z","closed_at":null,"body":"It seems that using @keyscope on the root `<map>` element causes builds to fail. (Put aside for the moment the fact that a keyspace on `<map>` is a bad practice. The spec allows it, so it should work: \"Map authors define  the boundaries for key scopes by specifying the @keyscope attribute on `<map>` elements, `<topicref>` elements, or elements that are specializations of `<map>` or `<topicref>`. \")\r\n\r\nSample map:\r\n\r\n```xml\r\n<map keyscope=\"widget\">\r\n   <title>Keyscope test 4</title>\r\n   <keydef keys=\"module\">\r\n      <topicmeta>\r\n         <keywords>\r\n            <keyword>Widget</keyword>\r\n         </keywords>\r\n      </topicmeta>\r\n   </keydef>\r\n   <topicgroup keyscope=\"gadget\">\r\n      <keydef keys=\"module\">\r\n         <topicmeta>\r\n            <keywords>\r\n               <keyword>Gadget</keyword>\r\n            </keywords>\r\n         </topicmeta>\r\n      </keydef>\r\n      <topicref href=\"topic1.xml\" keyscope=\"doodad\">\r\n         <keydef keys=\"module\">\r\n            <topicmeta>\r\n               <keywords>\r\n                  <keyword>Doodad</keyword>\r\n               </keywords>\r\n            </topicmeta>\r\n         </keydef>\r\n      </topicref>\r\n   </topicgroup>\r\n</map>\r\n```\r\n\r\nWith a simple keyref such as `<ph keyref=\"module\"/>` in topic1.xml, the build fails. With a pathed keyref such as `<ph keyref=\"widget.gadget.doodad.module/>` in topic7.xml, the build still fails.\r\n\r\nRemoving the keyspace definition from the `<map>` and using `<ph keyref=\"module\"/>` in topic1.xml, the key resolves to \"Widget,\" as expected. Using `<ph keyref=\"gadget.doodad.module\"/>`, the key resolves to \"Doodad,\" as expected."},"comment":{"url":"https://api.github.com/repos/dita-ot/dita-ot/issues/comments/216891845","html_url":"https://github.com/dita-ot/dita-ot/issues/2339#issuecomment-216891845","issue_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/2339","id":216891845,"user":{"login":"drmacro","id":1004229,"avatar_url":"https://avatars.githubusercontent.com/u/1004229?v=3","gravatar_id":"","url":"https://api.github.com/users/drmacro","html_url":"https://github.com/drmacro","followers_url":"https://api.github.com/users/drmacro/followers","following_url":"https://api.github.com/users/drmacro/following{/other_user}","gists_url":"https://api.github.com/users/drmacro/gists{/gist_id}","starred_url":"https://api.github.com/users/drmacro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drmacro/subscriptions","organizations_url":"https://api.github.com/users/drmacro/orgs","repos_url":"https://api.github.com/users/drmacro/repos","events_url":"https://api.github.com/users/drmacro/events{/privacy}","received_events_url":"https://api.github.com/users/drmacro/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T14:58:29Z","updated_at":"2016-05-04T14:58:29Z","body":"I'm not sure specifying @keyscope on map elements is necessarily bad practice. On root maps it basically has no effect (because all the keys defined in the map will be within the named scope so unqualified key references will resolve).\r\n\r\nOn submaps it can make sense to specify @keyscope on the map element, which can then be used as the scope name for references to keys within that submap from outside the submap's context. That ensures that the submap is always a separate scope even if the author of the using map does not specify a scope on the reference to the submap.\r\n"}}