Diff for 12013 design

Fri, 2008-06-13 05:02 by imagiczhangFri, 2008-06-13 05:42 by imagiczhang
Changes to Body
Line 9Line 9
 
technical design for the change</span></em></strong>
 
technical design for the change</span></em></strong>
 
</p>
 
</p>
-
In conrefImpl.xsl, when  the target of @conref is processed, the code first copy or proceed all @* attributes of target elements and then use apply-templates on its sub-nodes. After that we need to add the code to check whether @conrefend is valid and proceed the elements in the conref range. Since the template to proceed conref target doesn't know whether there is @conrefend at conref source, the value of @conrefend should be passed as parameter. <br />
+
<p>
-
<br />
+
In conrefImpl.xsl, when the target of @conref is processed, the code first copy or proceed all @* attributes of target elements and then use apply-templates on its sub-nodes. After that we need to add the code to check whether @conrefend is valid and proceed the elements in the conref range. Since the template to proceed conref target doesn't know whether there is @conrefend at conref source, the value of @conrefend should be passed as parameter. <br />
-
<br />
+
Here is the current template to proceed conref-target in conrefImpl.xsl with update comments in bold
  +
</p>
  +
<p>
  +
&lt;xsl:template match=&quot;*&quot; mode=&quot;conref-target&quot;&gt;
  +
</p>
  +
<p>
  +
<strong>**************** We need to add a parameter here to accept the value of @conrefend. The default value is #none# which means that there is no @conrefend ***************************</strong>
  +
</p>
  +
<p>
  +
  &lt;xsl:param name=&quot;WORKDIR&quot;/&gt;<br />
  +
  &lt;xsl:param name=&quot;conref-source-topicid&quot;/&gt;<br />
  +
  &lt;xsl:param name=&quot;conref-ids&quot;/&gt;<br />
  +
  &lt;xsl:param name=&quot;source-element&quot;/&gt;<br />
  +
  &lt;xsl:param name=&quot;current-relative-path&quot;/&gt; &lt;!-- File system path from original file to here --&gt;<br />
  +
  &lt;xsl:param name=&quot;conref-filename&quot;/&gt;<br />
  +
.......calculate topic id and element id..........
  +
</p>
  +
<p>
  +
   &lt;!-- If for some bizarre reason you conref to another element that uses @conref, forget the original and continue here. --&gt;
  +
</p>
  +
<p>
  +
&lt;xsl:choose&gt;<br />
  +
    &lt;xsl:when test=&quot;@conref&quot;&gt;<br />
  +
.......proceed @conref of the conref target.........<br />
  +
    &lt;/xsl:when&gt;<br />
  +
    &lt;xsl:otherwise&gt;<br />
  +
        &lt;xsl:for-each select=&quot;@*&quot;&gt;<br />
  +
            .......proceed every @* attribute.........<br />
  +
        &lt;/xsl:for-each&gt;<br />
  +
        <br />
  +
        &lt;!-- Continue processing this element as any other --&gt;<br />
  +
        &lt;xsl:apply-templates select=&quot;*|comment()|processing-instruction()|text()&quot;&gt;<br />
  +
          ......apply templates on sub-nodes.......<br />
  +
        &lt;/xsl:apply-templates&gt;<br />
  +
    &lt;/xsl:otherwise&gt;<br />
  +
  &lt;/xsl:choose&gt;
  +
</p>
  +
<p>
  +
<strong>***************************************************************</strong><br />
  +
<strong>Here we need to add the logic to proceed @conrefend if the value of @conrefend is sent to this template as variable.</strong>
  +
</p>
  +
<p>
  +
<strong>***************************************************************</strong>
  +
</p>
  +
<p>
  +
&lt;/xsl:template&gt;
  +
</p>
  +
<p>
  +
&nbsp;
  +
</p>
  +
<p>
  +
&nbsp;
  +
</p>
 
<h3><strong><em><span>What sections of the toolkit will be impacted by the
 
<h3><strong><em><span>What sections of the toolkit will be impacted by the
 
change?</span></em></strong><em><span> </span></em></h3>
 
change?</span></em></strong><em><span> </span></em></h3>
Revision of Fri, 2008-06-13 05:42:

12013 design

Design for item

What user need will be met by this feature?

Users can use @conref combined with @conrefend to refer to a range of sibling elements and pull them into the specified location.

What is the technical design for the change

In conrefImpl.xsl, when the target of @conref is processed, the code first copy or proceed all @* attributes of target elements and then use apply-templates on its sub-nodes. After that we need to add the code to check whether @conrefend is valid and proceed the elements in the conref range. Since the template to proceed conref target doesn't know whether there is @conrefend at conref source, the value of @conrefend should be passed as parameter.
Here is the current template to proceed conref-target in conrefImpl.xsl with update comments in bold

<xsl:template match="*" mode="conref-target">

**************** We need to add a parameter here to accept the value of @conrefend. The default value is #none# which means that there is no @conrefend ***************************

  <xsl:param name="WORKDIR"/>
  <xsl:param name="conref-source-topicid"/>
  <xsl:param name="conref-ids"/>
  <xsl:param name="source-element"/>
  <xsl:param name="current-relative-path"/> <!-- File system path from original file to here -->
  <xsl:param name="conref-filename"/>
.......calculate topic id and element id..........

   <!-- If for some bizarre reason you conref to another element that uses @conref, forget the original and continue here. -->

<xsl:choose>
    <xsl:when test="@conref">
.......proceed @conref of the conref target.........
    </xsl:when>
    <xsl:otherwise>
        <xsl:for-each select="@*">
            .......proceed every @* attribute.........
        </xsl:for-each>
       
        <!-- Continue processing this element as any other -->
        <xsl:apply-templates select="*|comment()|processing-instruction()|text()">
          ......apply templates on sub-nodes.......
        </xsl:apply-templates>
    </xsl:otherwise>
  </xsl:choose>

***************************************************************
Here we need to add the logic to proceed @conrefend if the value of @conrefend is sent to this template as variable.

***************************************************************

</xsl:template>

 

 

What sections of the toolkit will be impacted by the change?

The change will impact conref resolution xslt script.

See also

none

XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I