OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

dita message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [dita] TractorX Example


I want to try and tease out the hypothetical Eliot brought up during the TC
call today. Imagine, today, you had two DITA maps for different tractor
models, TractorX.ditamap and TractorY.ditamap. There also exists a third
map,  AllTractors.ditamap, that included both TractorX and TractorY. Because
we live in a DITA 1.2 world, where a given root map has exactly one key
space, we?ve prefixed all of our keys with their context. This allows one of
the TractorY topics to reference a key in the TractorX map.

TractorX.ditamap
----------------
<map>
  <title>Tractor X</title>
  <topicref id="x1"
            keys="TractorX.OilChart"
            href="TractorX/oilChart.dita"/>
  <topicref keys="TractorX.RegularMaintenance"
            id="x2"
            href="TractorX/regularMaintenance.dita"/>
</map>

TractorY.ditamap
----------------
<map>
  <title>Tractor Y</title>
  <topicref id="y1"
            keys="TractorY.OilChart"
            href="TractorY/oilChart.dita"/>
  <topicref id="y2"
            keys="TractorY.RegularMaintenance"
            href="TractorY/RegularMaintenance.dita"/>
</map>

AllTractors.ditamap
-----------------------
<map>
  <title>All Tractors</title>
  <mapref href="TractorX.ditamap"/>
  <mapref href="TractorY.ditamap"/>
</map>

TractorY/RegularMaintenance.dita
--------------------------------
<topic id="topic">
  <title>Regular Maintenance</title>
  <body>
    <p>Refer to <xref keyref="TractorX.RegularMaintenance"/>,
       using <xref keyref="TractorY.OilChart"/> for the oil
       chart.</p>
  </body>
</topic>

EFFECTIVE KEY SPACE FOR AllTractors.ditamap
-------------------------------------------
TractorX.OilChart=x1
TractorX.RegularMaintenance=x2
TractorY.OilChart=y1
TractorY.RegularMaintenance=y2


So DITA 1.3 comes out with the scoped keys feature as currently described in
13004. The author of AllTractors.ditamap introduces them (for reasons I
don't quite understand).

AllTractors.ditamap with Scopes
-------------------------------
<map>
  <title>All Tractors</title>
  <mapref href="TractorX.ditamap"
          keyscope="tractor-x"/>
  <mapref href="TractorY.ditamap"
          keyscope="tractor-y"/>
</map>

This turns the single key space into three key spaces.

ROOT KEY SPACE
--------------
tractor-x.TractorX.OilChart=x1
tractor-x.TractorX.RegularMaintenance=x2
tractor-y.TractorY.OilChart=y1
tractor-y.TractorY.RegularMaintenance=y2

TRACTOR X KEY SPACE
-------------------
(inherited from root)
tractor-x.TractorX.OilChart=x1
tractor-x.TractorX.RegularMaintenance=x2
tractor-y.TractorY.OilChart=y1
tractor-y.TractorY.RegularMaintenance=y2
(scoped key names)
TractorX.OilChart=x1
TractorX.RegularMaintenance=x2

TRACTOR Y KEY SPACE
-------------------
(inherited from root)
tractor-x.TractorX.OilChart=x1
tractor-x.TractorX.RegularMaintenance=x2
tractor-y.TractorY.OilChart=y1
tractor-y.TractorY.RegularMaintenance=y2
(scoped key names)
TractorY.OilChart=y1
TractorY.RegularMaintenance=y2


The problem here, as Eliot points out, is that the reference to
TractorX.OilChart from TractorY/RegularMainenance.dita will no longer
resolve, because that key is no longer defined in Tractor Y's key space.
However, the reference to TractorY.OilChart will continue to work just fine,
as will any other reference to a TractorY key from within a TractorY key
scope.

The author now has a number of ways to fix the problem.

* Change the key reference to "tractor-x.TractorX.RegularMaintenance".
* Add a new <keydef> to TractorY.ditamap for "TractorX.RegularMaintenance".
* Add a new <keydef> to AllTractors.ditamap for
"TractorX.RegularMaintenance" (which would override the definition in the
tractor-x scope, but would make the key visible to all child scopes).

Chris


Chris Nitchie
Oberon Technologies, Inc.
2640 Wildwood Trail
Saline, MI  48176
Main: 734.666.0400 Ext. 503
Direct: 734.330.2978
Email: chris.nitchie@oberontech.com
www.oberontech.com






[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]