Re: Using nested keys on coverpage


Chris Papademetrious
 

Hi Chris,

I changed the input map to this:

<bookmap xml:lang="en">
  <booktitle>
    <mainbooktitle>MAIN: <ph keyref="oneref"/> <ph keyref="tworefs"/> <ph keyref="threerefs"/></mainbooktitle>
    <booktitlealt>ALT: <ph keyref="oneref"/> <ph keyref="tworefs"/> <ph keyref="threerefs"/></booktitlealt>
  </booktitle>
  <frontmatter>

    <keydef keys="oneref">
      <topicmeta>
        <keywords>
          <keyword>VALUE</keyword>
        </keywords>
      </topicmeta>
    </keydef>

    <keydef keys="tworefs">
      <topicmeta>
        <keywords>
          <keyword keyref="oneref"/>
        </keywords>
      </topicmeta>
    </keydef>

    <keydef keys="threerefs">
      <topicmeta>
        <keywords>
          <keyword keyref="tworefs"/>
        </keywords>
      </topicmeta>
    </keydef>

  </frontmatter>
  <chapter href="chapter.dita"/>
</bookmap>

Using ditaot_save_preprocessing.pl, I found that the map looks like this after the keyref preprocessing stage:

<bookmap xml:lang="en">
   <booktitle>
      <mainbooktitle>MAIN:
         <ph keyref="oneref">VALUE</ph>

         <ph keyref="tworefs"/>
         <ph keyref="threerefs"/>
      </mainbooktitle>
      <booktitlealt>ALT:
         <ph keyref="oneref">VALUE</ph>

         <ph keyref="tworefs"/>
         <ph keyref="threerefs"/>
      </booktitlealt>
   </booktitle>
   <frontmatter>
      <keydef keys="oneref" processing-role="resource-only">
         <topicmeta>
            <keywords>
               <keyword>VALUE</keyword>
            </keywords>
         </topicmeta>
      </keydef>
      <keydef keys="tworefs" processing-role="resource-only">
         <topicmeta>
            <keywords>
               <keyword keyref="oneref">VALUE</keyword>
            </keywords>
         </topicmeta>
      </keydef>
      <keydef keys="threerefs" processing-role="resource-only">
         <topicmeta>
            <keywords>
               <keyword keyref="tworefs"/>
            </keywords>
         </topicmeta>
      </keydef>
   </frontmatter>
   <chapter href="3e66b91a527450babed37211b43c138ab372caa1.dita"/>
</bookmap>

The variable definitions resolve to two levels, but not further. The title variables resolve one level, but not further. The book title substitutions and the nested key substitutions happen within the same keyref preprocessing stage. But I don't know enough about the keyref Java code to have further insight.

 - Chris

Join main@dita-users.groups.io to automatically receive all group messages.