Requirement and tasks relationship

Monday, April 19, 2021
Avatar

I tried to create a standard report which filter out the requirement and tasks. The template is as below.

    <xsl:for-each select="Requirement">
       <tr>
          <td>
            <xsl:value-of select="RequirementId"/>
          </td>
          <td>
            <xsl:attribute name="style">
              padding-left: <xsl:value-of select="string-length(IndentLevel)*2"/>px;
            </xsl:attribute>
            <xsl:if test="IsSummary='True'">
              <b>
                <xsl:value-of select="Name"/>
              </b>
            </xsl:if>
            <xsl:if test="IsSummary='False'">
              <xsl:value-of select="Name"/>
            </xsl:if>
          </td>
          <xsl:for-each select='Tasks/Task'>
			<tr>
			  <td>
				<b>
				  <xsl:value-of select="TaskId"/>
				</b>
			  </td>
			  <td>
				<xsl:value-of select="Name"/>
			  </td>
			</tr>
		  </xsl:for-each>
		</tr>
      </xsl:for-each>

 

I find that the second for-each is not working to retrieve the Task information.

 

May I know if it is possible to do so?

And if there is any document with corresponding information on the artifects relationship?

 

2 Replies
Monday, April 19, 2021
Avatar
re: ricky.wong Monday, April 19, 2021

Hi Ricky

That should work, but it would depend on the base XML data you are getting back.

I would run the same report in Raw XML mode and see what data comes back, specifically if the child "Tasks" collection is being populated.

Regards

David

Tuesday, April 20, 2021
Avatar
re: inflectra.david Monday, April 19, 2021

Hi David,

Thanks for your reply. For your information, I am using the <xsl:template match="/RequirementData">. Will it be the problem?

 

Regards,

Ricky Wong

Statistics
  • Started: Monday, April 19, 2021
  • Last Reply: Tuesday, April 20, 2021
  • Replies: 2
  • Views: 1528