Example: Using <dvrKeyscopePrefix> to control key scope names

This section is non-normative.

In this scenario, a <ditavalref> element uses the nested <dvrKeyscopePrefix> element to control the names of key scopes within the filtered branch.

The following code sample shows how <dvrKeyscopePrefix> supplements the existing key scope name of branch-01 to establish two new effective key scopes:
<topicref keys="branch-01"
    href="branch-01.dita" 
    keyscope="branch-01"
  >
  <ditavalref href="condition-01.ditaval">
    <ditavalmeta>
      <dvrResourcePrefix>firstcond-</dvrResourcePrefix>
      <dvrKeyscopePrefix>green-</dvrKeyscopePrefix>
    </ditavalmeta>
  </ditavalref>
  <ditavalref href="condition-01.ditaval">
    <ditavalmeta>
      <dvrResourcePrefix>secondcond-</dvrResourcePrefix>
      <dvrKeyscopePrefix>blue-</dvrKeyscopePrefix>
    </ditavalmeta>
  </ditavalref>
  <keydef keys="productName">
    <topicmeta><keytext>Acme's Best Microchip</keytext></topicmeta>
  </keydef>
  <topicref href="topics/subtopic-01.dita"/>
</topicref>
After the <ditavalref> elemets are evaluated:
  • With two <ditavalref> elemets, two effective copies of the branch are created.
  • For the first effective copy of the branch:
    • The effective key scope is green-branch-01
    • The effective file names of the resources in the branch are firstcond-branch-01.dita and topics/firstcond-subtopic-01.dita
  • For the second effective copy of the branch:
    • The effective key scope is blue-branch-01
    • The effective file names of the resources in the branch are secondcond-branch-01.dita and topics/secondcond-subtopic-01.dita