Diff for Design for implementing OASIS Item 12026
Thu, 2008-10-16 08:44 by zhou.youyi | Thu, 2008-10-16 08:54 by zhou.youyi | ||
---|---|---|---|
< previous diff | next diff > | ||
Changes to Body | |||
Line 1 | Line 1 | ||
- | <!--[if gte mso 9]><xml>
| + | <p>
|
- | <w:WordDocument>
| + | <em><strong>What user need will be met by this feature?</strong></em>
|
- | <w:View>Normal</w:View>
| + | |
- | <w:Zoom>0</w:Zoom>
| + | |
- | <w:PunctuationKerning/>
| + | |
- | <w:DrawingGridVerticalSpacing>7.8 ?</w:DrawingGridVerticalSpacing>
| + | |
- | <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
| + | |
- | <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
| + | |
- | <w:ValidateAgainstSchemas/>
| + | |
- | <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
| + | |
- | <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
| + | |
- | <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
| + | |
- | <w:Compatibility>
| + | |
- | <w:SpaceForUL/>
| + | |
- | <w:BalanceSingleByteDoubleByteWidth/>
| + | |
- | <w:DoNotLeaveBackslashAlone/>
| + | |
- | <w:ULTrailSpace/>
| + | |
- | <w:DoNotExpandShiftReturn/>
| + | |
- | <w:AdjustLineHeightInTable/>
| + | |
- | <w:BreakWrappedTables/>
| + | |
- | <w:SnapToGridInCell/>
| + | |
- | <w:WrapTextWithPunct/>
| + | |
- | <w:UseAsianBreakRules/>
| + | |
- | <w:DontGrowAutofit/>
| + | |
- | <w:UseFELayout/>
| + | |
- | </w:Compatibility>
| + | |
- | <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
| + | |
- | </w:WordDocument>
| + | |
- | </xml><![endif]--><!--[if gte mso 9]><xml>
| + | |
- | <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
| + | |
- | </w:LatentStyles>
| + | |
- | </xml><![endif]--><!--[if !mso]>
| + | |
- | <object
| + | |
- | classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui>
| + | |
- | </object>
| + | |
- | <style>
| + | |
- | st1\:*{behavior:url(#ieooui) }
| + | |
- | </style>
| + | |
- | <![endif]-->
| + | |
- | <!--
| + | |
- | /* Font Definitions */
| + | |
- | @font-face
| + | |
- | {font-family:??;
| + | |
- | panose-1:2 1 6 0 3 1 1 1 1 1;
| + | |
- | mso-font-alt:SimSun;
| + | |
- | mso-font-charset:134;
| + | |
- | mso-generic-font-family:auto;
| + | |
- | mso-font-pitch:variable;
| + | |
- | mso-font-signature:3 135135232 16 0 262145 0;}
| + | |
- | @font-face
| + | |
- | {font-family:"\@??";
| + | |
- | panose-1:2 1 6 0 3 1 1 1 1 1;
| + | |
- | mso-font-charset:134;
| + | |
- | mso-generic-font-family:auto;
| + | |
- | mso-font-pitch:variable;
| + | |
- | mso-font-signature:3 135135232 16 0 262145 0;}
| + | |
- | @font-face
| + | |
- | {font-family:Tahoma;
| + | |
- | panose-1:2 11 6 4 3 5 4 4 2 4;
| + | |
- | mso-font-charset:0;
| + | |
- | mso-generic-font-family:swiss;
| + | |
- | mso-font-pitch:variable;
| + | |
- | mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
| + | |
- | /* Style Definitions */
| + | |
- | p.MsoNormal, li.MsoNormal, div.MsoNormal
| + | |
- | {mso-style-parent:"";
| + | |
- | margin:0cm;
| + | |
- | margin-bottom:.0001pt;
| + | |
- | text-align:justify;
| + | |
- | text-justify:inter-ideograph;
| + | |
- | mso-pagination:none;
| + | |
- | font-size:10.5pt;
| + | |
- | mso-bidi-font-size:12.0pt;
| + | |
- | font-family:"Times New Roman";
| + | |
- | mso-fareast-font-family:??;
| + | |
- | mso-font-kerning:1.0pt;}
| + | |
- | /* Page Definitions */
| + | |
- | @page
| + | |
- | {mso-page-border-surround-header:no;
| + | |
- | mso-page-border-surround-footer:no;}
| + | |
- | @page Section1
| + | |
- | {size:595.3pt 841.9pt;
| + | |
- | margin:72.0pt 90.0pt 72.0pt 90.0pt;
| + | |
- | mso-header-margin:42.55pt;
| + | |
- | mso-footer-margin:49.6pt;
| + | |
- | mso-paper-source:0;
| + | |
- | layout-grid:15.6pt;}
| + | |
- | div.Section1
| + | |
- | {page:Section1;}
| + | |
- | /* List Definitions */
| + | |
- | @list l0
| + | |
- | {mso-list-id:736591327;
| + | |
- | mso-list-type:hybrid;
| + | |
- | mso-list-template-ids:-859795842 -2122811750 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
| + | |
- | @list l0:level1
| + | |
- | {mso-level-tab-stop:18.0pt;
| + | |
- | mso-level-number-position:left;
| + | |
- | margin-left:18.0pt;
| + | |
- | text-indent:-18.0pt;}
| + | |
- | @list l0:level2
| + | |
- | {mso-level-number-format:alpha-lower;
| + | |
- | mso-level-text:"%2\)";
| + | |
- | mso-level-tab-stop:42.0pt;
| + | |
- | mso-level-number-position:left;
| + | |
- | margin-left:42.0pt;
| + | |
- | text-indent:-21.0pt;}
| + | |
- | ol
| + | |
- | {margin-bottom:0cm;}
| + | |
- | ul
| + | |
- | {margin-bottom:0cm;}
| + | |
- | -->
| + | |
- | <!--[if gte mso 10]>
| + | |
- | <style>
| + | |
- | /* Style Definitions */
| + | |
- | table.MsoNormalTable
| + | |
- | {mso-style-name:????;
| + | |
- | mso-tstyle-rowband-size:0;
| + | |
- | mso-tstyle-colband-size:0;
| + | |
- | mso-style-noshow:yes;
| + | |
- | mso-style-parent:"";
| + | |
- | mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
| + | |
- | mso-para-margin:0cm;
| + | |
- | mso-para-margin-bottom:.0001pt;
| + | |
- | mso-pagination:widow-orphan;
| + | |
- | font-size:10.0pt;
| + | |
- | font-family:"Times New Roman";
| + | |
- | mso-ansi-language:#0400;
| + | |
- | mso-fareast-language:#0400;
| + | |
- | mso-bidi-language:#0400;}
| + | |
- | </style>
| + | |
- | <![endif]-->
| + | |
- | <p class="MsoNormal">
| + | |
- | <strong><em><span style="font-family: Tahoma">What user
| + | |
- | need will be met by this feature?</span></em></strong><strong><span style="font-family: Tahoma"></span></strong>
| + | |
</p>
| </p>
| ||
- | <p class="MsoNormal">
| + | <p>
|
- | <span style="font-family: Tahoma">Users can define
| + | Users can define various glossary entries which serve as specific terms or acronyms. Such glossary entries will be expanded to appropriate form according to the context automatically.
|
- | various glossary entries which serve as specific terms or acronyms. Such
| + | |
- | glossary entries will be expanded to appropriate form according to the context
| + | |
- | automatically.</span>
| + | |
</p>
| </p>
| ||
- | <p class="MsoNormal">
| + | <p>
|
- | <span style="font-family: Tahoma"> </span>
| + | <strong><em>What is the technical design for the change?</em></strong>
|
</p>
| </p>
| ||
- | <p class="MsoNormal">
| + | <p>
|
- | <strong><em><span style="font-family: Tahoma">What is
| + | Key definitions and references are already prepared during key definition parsing process, so we mainly focus on how to resolve keyref accordingly in appropriate contexts. Here we have 2 problems yet to solve while resolving the keys:
|
- | the technical design for the change?</span></em></strong><span style="font-family: Tahoma"></span>
| + | |
</p>
| </p>
| ||
- | <p class="MsoNormal">
| + | <p>
|
- | <span style="font-family: Tahoma">Key definitions
| + | 1. How to determine in what context a key is referenced? The description on how to distinguish introductory context from other contexts in “DITA Proposed Feature #12026 and #12038” is not clear enough to define all possible contexts that would be encountered. Thus we classify the contexts into three specific situations for the time being. More accurate definition and classification of different contexts should be considered thoroughly and added later.
|
- | and references are already prepared during key definition parsing process, so
| + | |
- | we mainly focus on how to resolve keyref accordingly in appropriate contexts.
| + | |
- | Here we have 2 problems yet to solve while resolving the keys:</span>
| + | |
</p>
| </p>
| ||
- | <p style="margin-left: 18pt; text-indent: -18pt" class="MsoNormal">
| + | <blockquote>
|
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>1.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | <p>
|
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">How
| + | a) The very first appearance of a keyref pointing to a certain glossentry in a deliverable book context should be expanded to its surface form; otherwise an acronym form (or other forms appropriate) should be used. Intuitively, the very first topic entity that we encounter during preprocess (either directly in a topic dita file or indirectly referenced in a ditamap file) would be an introductory context for the whole book. Thus, all keyrefs appearing in this first topic should be expanded to surface form. Keyrefs in other contexts are replaces with other appropriate forms of the corresponding glossentry. Here is a potential pitfall. The same target (glossentry) may appear for many times even in the same topic, and might be associated with and referenced by different keys. For example, key “A” and key “B” may be associated with the same target file “glossary.dita”. Within the same topic “A” and “B” are both referenced though, they should be treated differently. The one appearing first possibly deserves an expansion but the other doesn’t. This case requires that we should consider all keyrefs resolved to the same target in one place.
|
- | to determine in what context a key is referenced? The description on how to distinguish
| + | </p>
|
- | introductory context from other contexts in “<strong>DITA Proposed Feature #12026
| + | </blockquote>
|
- | and #12038” </strong><span>is not clear enough to define all possible
| + | <blockquote>
|
- | contexts that would be encountered. Thus we classify the contexts into three
| + | <p>
|
- | specific situations for the time being. More accurate definition and
| + | b) The terms appearing in online documents should have a hover tooltip of its surface form. Unlike the processing of situation (a), terms in online documents doesn’t need to be expanded and it’s also hard to determine which context is introductory or not because user may access the pages in any possible sequence. Thus we think using a preferred form defined in glossentry as the term’s appearance and its surface form as a hover tooltip would be enough.
|
- | classification of different contexts should be considered thoroughly and added
| + | </p>
|
- | later.</span></span>
| + | </blockquote>
|
+ | <blockquote>
| ||
+ | <p>
| ||
+ | c) Terms appearing in copyright declaration should be expanded to its surface form.
| ||
+ | </p>
| ||
+ | </blockquote>
| ||
+ | <blockquote>
| ||
+ | <p>
| ||
+ | Note: Other contexts should be considered, as a warranty related context may need surface forms of certain terms.
| ||
+ | </p>
| ||
+ | </blockquote>
| ||
+ | <p>
| ||
+ | 2. How the contents of glossentries are saved and used. We prefer to use a lazy-loading mechanism as follows:
| ||
</p>
| </p>
| ||
- | <p style="margin-left: 42pt; text-indent: -21pt" class="MsoNormal">
| + | <blockquote>
|
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>a)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | <p>
|
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">The very first appearance of a keyref pointing to a
| + | a) First we need a Hashtable to store the target that is defined with a key as the hash-key and an appropriate form of the term as the hash-value. For example
|
- | certain glossentry in a deliverable book context should be expanded to its
| + | </p>
|
- | surface form; otherwise an acronym form (or other forms appropriate) should be
| + | </blockquote>
|
- | used. Intuitively, the very first topic entity that we encounter during
| + | <blockquote>
|
- | preprocess (either directly in a topic dita file or indirectly referenced in a
| + | <pre>
|
- | ditamap file) would be an introductory context for the whole book. Thus, all
| + | <glossentry keys="aKey" href="glossgroup.dita#aTerm"/>
|
- | keyrefs appearing in this first topic should be expanded to surface form.
| + | </pre>
|
- | Keyrefs in other contexts are replaces with other appropriate forms of the
| + | </blockquote>
|
- | corresponding glossentry. Here is a potential pitfall. The same target
| + | <p>
|
- | (glossentry) may appear for many times even in the same topic, and might be
| + |
|
- | associated with and referenced by different keys. For example, key “A” and key
| + | |
- | “B” may be associated with the same target file “glossary.dita”. Within the
| + | |
- | same topic “A” and “B” are both referenced though, they should be treated
| + | |
- | differently. The one appearing first possibly deserves an expansion but the
| + | |
- | other doesn’t. This case requires that we should consider all keyrefs resolved
| + | |
- | to the same target in one place.</span>
| + | |
</p>
| </p>
| ||
- | <p style="margin-left: 42pt; text-indent: -21pt" class="MsoNormal">
| + | <blockquote>
|
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>b)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | <p>
|
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">The terms appearing in online documents should have
| + | defines a key with target “glossgroup.dita#aTerm”. In glossgroup.dita a glossentry is defined as:
|
- | a hover tooltip of its surface form. Unlike the processing of situation (a),
| + | </p>
|
- | terms in online documents doesn’t need to be expanded and it’s also hard to
| + | </blockquote>
|
- | determine which context is introductory or not because user may access the
| + | <blockquote>
|
- | pages in any possible sequence. Thus we think using a preferred form defined in
| + | <pre>
|
- | glossentry as the term’s appearance and its surface form as a hover tooltip
| + | <glossentry id="aTerm">
|
- | would be enough.</span>
| + | </pre>
|
+ | <pre>
| ||
+ | <glossterm>A term</glossterm>
| ||
+ | </pre>
| ||
+ | <pre>
| ||
+ | <glossBody>
| ||
+ | </pre>
| ||
+ | <pre>
| ||
+ | <glossSurfaceForm>A term that should be resolved (aTerm)</glossSurfaceForm>
| ||
+ | </pre>
| ||
+ | <pre>
| ||
+ | <glossAlt>
| ||
+ | </pre>
| ||
+ | <pre>
| ||
+ | <glossAcronym>AT</glossAcronym>
| ||
+ | </pre>
| ||
+ | <pre>
| ||
+ | </glossAlt>
| ||
+ | </pre>
| ||
+ | <pre>
| ||
+ | </glossBody>
| ||
+ | </pre>
| ||
+ | <pre>
| ||
+ | </glossentry>
| ||
+ | </pre>
| ||
+ | <p>
| ||
+ |
| ||
+ | </p>
| ||
+ | </blockquote>
| ||
+ | <blockquote>
| ||
+ | <p>
| ||
+ | Then the entry in Hashtable would be stored as (glossgroup.dita#aTerm, corresponding form). The corresponding form refers to a string combining the surface form and other preferred forms together separated by a stick. The reason why “aKey” is not used as hash-key is mention above. Since multiple keys could refer to the same target, it would be a waste of memories to store different keys with the same value and it may also cause problems in detecting whether it’s the first appearance of a certain term.
| ||
+ | </p>
| ||
+ | </blockquote>
| ||
+ | <blockquote>
| ||
+ | <p>
| ||
+ | b) When a keyref is being resolved, first we check that if there is an existing entry in the Hashtable by the target (e.g. glossgroup.dita#aTerm) that is associated with the reference key (e.g. aKey). If no such entry exists, the target should be parsed and corresponding surface form together with other preferred forms should be loaded and saved with the key into the Hashtable. According to the context this keyref is being parsed, appropriate form is applied.
| ||
+ | </p>
| ||
+ | </blockquote>
| ||
+ | <blockquote>
| ||
+ | <p>
| ||
+ | c) If there is an existing entry in the Hashtable, appropriate form is retrieved and used.
| ||
+ | </p>
| ||
+ | </blockquote>
| ||
+ | <p>
| ||
+ | <em><strong>What sections of the toolkit will be impacted by the change?</strong></em>
| ||
</p>
| </p>
| ||
- | <p style="margin-left: 42pt; text-indent: -21pt" class="MsoNormal">
| + | <p>
|
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>c)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | KeyRef resolution<br />
|
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">Terms appearing in copyright declaration should be
| + | <br />
|
- | expanded to its surface form.</span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 21pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"> </span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 21pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma">Note: Other contexts
| + | |
- | should be considered, as a warranty related context may need surface forms of
| + | |
- | certain terms.</span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 21pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"> </span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 18pt; text-indent: -18pt" class="MsoNormal">
| + | |
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>2.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | |
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">How the contents of glossentries are saved and used.
| + | |
- | We prefer to use a lazy-loading mechanism as follows:</span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt; text-indent: -21pt" class="MsoNormal">
| + | |
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>a)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | |
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">First we need a Hashtable to store the target that
| + | |
- | is defined with a key as the hash-key and an appropriate form of the term as
| + | |
- | the hash-value. For example:</span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><glossentry keys=”aKey” href=”glossgroup.dita#aTerm”/> defines a key with target
| + | |
- | “glossgroup.dita#aTerm”. In glossgroup.dita a glossentry is defined as:</span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><glossentry
| + | |
- | id=”aTerm”></span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><span> </span><glossterm>A term</glossterm></span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><span> </span><glossBody></span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt; text-indent: 21.75pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><glossSurfaceForm>A
| + | |
- | term that should be resolved (aTerm)</glossSurfaceForm></span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt; text-indent: 21.75pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><glossAlt></span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt; text-indent: 21.75pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><span> </span><glossAcronym>AT</glossAcronym></span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt; text-indent: 21.75pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"></glossAlt></span>
| + | |
- | </p>
| + | |
- | <p class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><span> </span></glossBody></span>
| + | |
- | </p>
| + | |
- | <p class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"><span> </span></glossentry></span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt" class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma">Then the entry in
| + | |
- | Hashtable would be stored as (glossgroup.dita#aTerm, corresponding form). The
| + | |
- | corresponding form refers to a string combining the surface form and other
| + | |
- | preferred forms together separated by a stick. The reason why “aKey” is not
| + | |
- | used as hash-key is mention above. Since multiple keys could refer to the same
| + | |
- | target, it would be a waste of memories to store different keys with the same
| + | |
- | value and it may also cause problems in detecting whether it’s the first
| + | |
- | appearance of a certain term.</span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt; text-indent: -21pt" class="MsoNormal">
| + | |
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>b)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | |
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">When a keyref is being resolved, first we check that
| + | |
- | if there is an existing entry in the Hashtable by the target (e.g.
| + | |
- | glossgroup.dita#aTerm) that is associated with the reference key (e.g. aKey).
| + | |
- | If no such entry exists, the target should be parsed and corresponding surface
| + | |
- | form together with other preferred forms should be loaded and saved with the
| + | |
- | key into the Hashtable. According to the context this keyref is being parsed, appropriate
| + | |
- | form is applied.</span>
| + | |
- | </p>
| + | |
- | <p style="margin-left: 42pt; text-indent: -21pt" class="MsoNormal">
| + | |
- | <!--[if !supportLists]--><span style="font-family: Tahoma"><span>c)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: 'Times New Roman'">
| + | |
- | </span></span></span><!--[endif]--><span style="font-family: Tahoma">If there is an existing entry in the Hashtable,
| + | |
- | appropriate form is retrieved and used.</span>
| + | |
- | </p>
| + | |
- | <p class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"> </span>
| + | |
- | </p>
| + | |
- | <p class="MsoNormal">
| + | |
- | <strong><em><span style="font-family: Tahoma">What
| + | |
- | sections of the toolkit will be impacted by the change?</span></em></strong><strong><span style="font-family: Tahoma"></span></strong>
| + | |
- | </p>
| + | |
- | <p class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma">KeyRef resolution</span>
| + | |
- | </p>
| + | |
- | <p class="MsoNormal">
| + | |
- | <span style="font-family: Tahoma"> </span>
| + | |
</p>
| </p>
| ||
Design for implementing OASIS Item 12026
What user need will be met by this feature?
Users can define various glossary entries which serve as specific terms or acronyms. Such glossary entries will be expanded to appropriate form according to the context automatically.
What is the technical design for the change?
Key definitions and references are already prepared during key definition parsing process, so we mainly focus on how to resolve keyref accordingly in appropriate contexts. Here we have 2 problems yet to solve while resolving the keys:
1. How to determine in what context a key is referenced? The description on how to distinguish introductory context from other contexts in “DITA Proposed Feature #12026 and #12038” is not clear enough to define all possible contexts that would be encountered. Thus we classify the contexts into three specific situations for the time being. More accurate definition and classification of different contexts should be considered thoroughly and added later.
a) The very first appearance of a keyref pointing to a certain glossentry in a deliverable book context should be expanded to its surface form; otherwise an acronym form (or other forms appropriate) should be used. Intuitively, the very first topic entity that we encounter during preprocess (either directly in a topic dita file or indirectly referenced in a ditamap file) would be an introductory context for the whole book. Thus, all keyrefs appearing in this first topic should be expanded to surface form. Keyrefs in other contexts are replaces with other appropriate forms of the corresponding glossentry. Here is a potential pitfall. The same target (glossentry) may appear for many times even in the same topic, and might be associated with and referenced by different keys. For example, key “A” and key “B” may be associated with the same target file “glossary.dita”. Within the same topic “A” and “B” are both referenced though, they should be treated differently. The one appearing first possibly deserves an expansion but the other doesn’t. This case requires that we should consider all keyrefs resolved to the same target in one place.
b) The terms appearing in online documents should have a hover tooltip of its surface form. Unlike the processing of situation (a), terms in online documents doesn’t need to be expanded and it’s also hard to determine which context is introductory or not because user may access the pages in any possible sequence. Thus we think using a preferred form defined in glossentry as the term’s appearance and its surface form as a hover tooltip would be enough.
c) Terms appearing in copyright declaration should be expanded to its surface form.
Note: Other contexts should be considered, as a warranty related context may need surface forms of certain terms.
2. How the contents of glossentries are saved and used. We prefer to use a lazy-loading mechanism as follows:
a) First we need a Hashtable to store the target that is defined with a key as the hash-key and an appropriate form of the term as the hash-value. For example
<glossentry keys="aKey" href="glossgroup.dita#aTerm"/>
defines a key with target “glossgroup.dita#aTerm”. In glossgroup.dita a glossentry is defined as:
<glossentry id="aTerm"> <glossterm>A term</glossterm> <glossBody> <glossSurfaceForm>A term that should be resolved (aTerm)</glossSurfaceForm> <glossAlt> <glossAcronym>AT</glossAcronym> </glossAlt> </glossBody> </glossentry>
Then the entry in Hashtable would be stored as (glossgroup.dita#aTerm, corresponding form). The corresponding form refers to a string combining the surface form and other preferred forms together separated by a stick. The reason why “aKey” is not used as hash-key is mention above. Since multiple keys could refer to the same target, it would be a waste of memories to store different keys with the same value and it may also cause problems in detecting whether it’s the first appearance of a certain term.
b) When a keyref is being resolved, first we check that if there is an existing entry in the Hashtable by the target (e.g. glossgroup.dita#aTerm) that is associated with the reference key (e.g. aKey). If no such entry exists, the target should be parsed and corresponding surface form together with other preferred forms should be loaded and saved with the key into the Hashtable. According to the context this keyref is being parsed, appropriate form is applied.
c) If there is an existing entry in the Hashtable, appropriate form is retrieved and used.
What sections of the toolkit will be impacted by the change?
KeyRef resolution