Tip : Business Capability Summary - displaying all parents

Post Reply
Rajaraman
Posts: 137
Joined: 02 May 2018, 12:20
Contact:

I refer https://essentialviewer.com/report?XML= ... 20Researchview

We are displaying parent business capability.

In case you want to display all its parents, grand parents, use the below code blocks appropriately. (especially child-> parent->grand parent->great grand parent and so on..

declarations

Code: Select all

  <xsl:variable name="parentCap1" select="$allBusinessCaps[name = $parentCap/own_slot_value[slot_reference = 'supports_business_capabilities']/value]"/>
   <xsl:variable name="parentCap2" select="$allBusinessCaps[name = $parentCap1/own_slot_value[slot_reference = 'supports_business_capabilities']/value]"/>
   <xsl:variable name="parentCap3" select="$allBusinessCaps[name = $parentCap2/own_slot_value[slot_reference = 'supports_business_capabilities']/value]"/>
   <xsl:variable name="parentCap4" select="$allBusinessCaps[name = $parentCap3/own_slot_value[slot_reference = 'supports_business_capabilities']/value]"/>

<!--Setup Parent Capability Section-->

Code: Select all

  <div class="content-section">
								<xsl:choose>
									<xsl:when test="count($parentCap1) = 0">
										<em>
											<!--<xsl:value-of select="eas:i18n('No parent capability captured')"/>-->
										</em>
									</xsl:when>
									<xsl:otherwise>
                                         
                                        <xsl:apply-templates select="$parentCap1" mode="renderBusParentCap"/>  
                    
								<!--		<xsl:call-template name="RenderInstanceLink">
											<xsl:with-param name="theSubjectInstance" select="$parentCap"/>
											<xsl:with-param name="theXML" select="$reposXML"/>
											<xsl:with-param name="viewScopeTerms" select="$viewScopeTerms"/>
                                                </xsl:call-template>
                            -->
									</xsl:otherwise>
								</xsl:choose>
							</div>
repeat for all parents..

and finally the function

Code: Select all

<xsl:template match="node()" mode="renderBusParentCap">
        <xsl:variable name="this" select="current()"/>
    <li>
        <xsl:call-template name="RenderInstanceLink">
		<xsl:with-param name="theSubjectInstance" select="$this"/>
		<xsl:with-param name="theXML" select="$reposXML"/>
		<xsl:with-param name="viewScopeTerms" select="$viewScopeTerms"/>
		</xsl:call-template>
    </li>
    </xsl:template>
Hope this helps some one.
closch
Posts: 44
Joined: 09 Jan 2018, 14:30

Nice - i've pushed into working page here - https://github.com/C-Losch/essential_vi ... ummary.xsl
Post Reply