question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@keyscope on the root <map> element causes builds to fail

See original GitHub issue

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>. ")

Sample map:

<map keyscope="widget">
   <title>Keyscope test 4</title>
   <keydef keys="module">
      <topicmeta>
         <keywords>
            <keyword>Widget</keyword>
         </keywords>
      </topicmeta>
   </keydef>
   <topicgroup keyscope="gadget">
      <keydef keys="module">
         <topicmeta>
            <keywords>
               <keyword>Gadget</keyword>
            </keywords>
         </topicmeta>
      </keydef>
      <topicref href="topic1.xml" keyscope="doodad">
         <keydef keys="module">
            <topicmeta>
               <keywords>
                  <keyword>Doodad</keyword>
               </keywords>
            </topicmeta>
         </keydef>
      </topicref>
   </topicgroup>
</map>

With 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.

Removing 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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
drmacrocommented, May 4, 2016

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).

On 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.

0reactions
jelovirtcommented, May 20, 2016

Fix NPE root cause, not with a workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The keyscope attribute - Oxygen XML Editor
The keyscope attribute consists of one or more space-separated key scope names. Map authors define the boundaries for key scopes by specifying the...
Read more >
Understanding Scoped Keys in DITA 1.3 - OASIS Open
Scoped keys apply to a defined key space within a map. This key space, defined by the keyscope attribute, can be the entire...
Read more >
DITA-OT error messages
Message ID Severity Message text DOTA013F Fatal Cannot find the specified DITAVAL ' %1 '. DOTJ012F Fatal Failed to parse the input file ' %1...
Read more >
waddrmgr - Go Packages
Unlocking the address manager causes the crypto private and script keys to be ... *Manager) FetchScopedKeyManager(scope KeyScope) (*ScopedKeyManager, error) ...
Read more >
dita-ot - Bountysource
Publish DITA topic or map in the context of a DITA root Map for resolving key ... In DITA-OT 2.2.1 an xref to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found