Creating Custom Reports using Microsoft Word 2007-2010 XSLT

Friday, December 4, 2015
Avatar
I would like to create a custom Printable Test Report using an XSLT derived from a Microsoft Word Document.  Essentially using a MS Word Template document and extracting the XSLT from it - and then replacing the fields with the appropriate XSLT "Select" statements extracted from the default SpiraTest Test Case Printable report template.

My question...  Can this be done - and has anyone had success using this process?  I created a valid XSLT using MS Word 2010 - but the resulting SpiraTest report output didn't format correctly.  Wondering if I need to use a MS Word 2007 document XSLT verses 2010?

Would greatly appreciate any feedback on this course of action before I march ahead.  Don't want to waste more time if it isn't going to work.

Thanks
4 Replies
Monday, December 7, 2015
Avatar
inflectra.sarahx
re: bkstigler Friday, December 4, 2015
Hi Brian

This is definitely possible, that is actually how we created the default XSLT template in the first place.

The key is to use the following:

- Microsoft WordML 2003 format if you are creating the MS-Word 2003 format report
- HTML format if you are creating the MS-Word 2007+ format report (use the option in MS-Word to save as HTML).

Regards

Sarah
Tuesday, December 8, 2015
Avatar
re: inflectra.sarahx Monday, December 7, 2015
Hi Sarah,
I've tried several variations on the XSLT without success.

This is one of the templates I'm attempting to use...  I have not been able to find the reference for a 2003 wordml schema...  I select a Word 2007 report type in SpiraTest - as I want an end report that is a Word document.  In all cases - I do not get anything formatted into a document table as desired.  Could you tell me what I'm missing?

Thanks,
Brian


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:o="urn:schemas-microsoft-com:office:office" 
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" 
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" 
xmlns:v="urn:schemas-microsoft-com:vml" 
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" 
xmlns:w10="urn:schemas-microsoft-com:office:word" 
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" 
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">

<xsl:template match="/TestRunData">
<xsl:processing-instruction name="mso-application">progid="Word.Document"</xsl:processing-instruction>
<w:document>
<w:body>

<w:p w:rsidR="002D122E" w:rsidRDefault="002D122E" w:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:sz w:val="28"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p w:rsidR="002D122E" w:rsidRDefault="002D122E" w:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:sz w:val="28"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:sz w:val="28"/>
</w:rPr>
<w:t>Test Cases in Report = <xsl:value-of select = "count(//TestRun)" /></w:t>
</w:r>
</w:p>
<w:p w:rsidR="002D122E" w:rsidRDefault="002D122E" w:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:sz w:val="28"/>
</w:rPr>
</w:pPr>
</w:p>

<xsl:for-each select="TestRun">
<br />
<br style="page-break-after : always"></br>
<!-- Test Case Title Paragraph -->
<w:p w:rsidR="00692B5F" w:rsidRPr="00542C17" w:rsidRDefault="00F32F5B" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestCaseTitle"/>
</w:pPr>
<w:r w:rsidR="00692B5F" w:rsidRPr="00542C17">
<w:t xml:space="preserve">
<xsl:variable name="TCId" select="TestCaseId"/>
<xsl:value-of select="Name"/><xsl:text> :: </xsl:text> (TC:<xsl:value-of select='format-number($TCId,"000000")'/>)
</w:t>
</w:r>
</w:p>
<!--  Description Paragraph -->
<w:p w:rsidR="00692B5F" w:rsidRPr="00622D51" w:rsidRDefault="008764A6" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestCaseDesc"/>
</w:pPr>
<w:r w:rsidR="00692B5F" w:rsidRPr="00622D51">
<w:t><xsl:value-of select="Description" disable-output-escaping="yes"/></w:t>
</w:r>
</w:p>
<!-- Paragraph for Table Label -->
<w:p w:rsidR="00692B5F" w:rsidRPr="00622D51" w:rsidRDefault="00437DB3" w:rsidP="00437DB3">
<w:pPr>
<w:pStyle w:val="TableHeaderTestSteps"/>
</w:pPr>
<w:r>
<w:t xml:space="preserve">Table </w:t>
</w:r>
<w:r w:rsidR="002D122E">
<w:t><xsl:value-of select="position()" /></w:t>
</w:r>
<w:r>
<w:t xml:space="preserve">:  Test </w:t>
</w:r>
<w:r w:rsidR="002D122E">
<w:t xml:space="preserve">Case </w:t>
</w:r>
<w:r>
<w:t>Steps</w:t>
</w:r>
</w:p>
<!--  End of Table Label Paragraph -->
<!--  Table Size Definition -->
<w:tbl>
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="9900" w:type="dxa"/>
<w:tblInd w:w="-162" w:type="dxa"/>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="643"/>
<w:gridCol w:w="3497"/>
<w:gridCol w:w="3240"/>
<w:gridCol w:w="2520"/>
</w:tblGrid>

<w:tr w:rsidR="003460A1" w:rsidRPr="00622D51" w:rsidTr="003460A1">
<w:trPr>
<w:cantSplit/>
<w:trHeight w:val="432"/>
<w:tblHeader/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="643" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6" w:themeFill="background1" w:themeFillShade="A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRPr="00622D51" w:rsidRDefault="003460A1" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestColHeaderStepNum"/>
</w:pPr>
<w:r w:rsidRPr="00622D51">
<w:t>Step</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3497" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6" w:themeFill="background1" w:themeFillShade="A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRPr="00622D51" w:rsidRDefault="00AA62D3" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableColHeader"/>
</w:pPr>
<w:r>
<w:t xml:space="preserve">Step </w:t>
</w:r>
<w:r w:rsidR="0074690E">
<w:t>Description</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3240" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6" w:themeFill="background1" w:themeFillShade="A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRPr="00622D51" w:rsidRDefault="003460A1" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableColHeader"/>
</w:pPr>
<w:r w:rsidRPr="00622D51">
<w:t>Expected Result</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2520" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6" w:themeFill="background1" w:themeFillShade="A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRPr="00622D51" w:rsidRDefault="0074690E" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableColHeader"/>
</w:pPr>
<w:r>
<w:t>Comment</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<!-- End Table Header Row -->

<xsl:call-template name="display-testrunsteps">
<xsl:with-param name="TestRunId" select="TestRunId" />
</xsl:call-template>
</w:tbl>

</xsl:for-each>

  </w:body>
</w:document>
</xsl:template>


<xsl:template name="display-testrunsteps">
<xsl:param name="TestRunId" />
<xsl:if test="/TestRunData/TestRunStep[TestRunId=$TestRunId]">
<xsl:for-each select="/TestRunData/TestRunStep[TestRunId=$TestRunId]">
<!-- Start of Test Step Row Output -->
<w:tr w:rsidR="003460A1" w:rsidTr="003460A1">
<w:trPr>
<w:cantSplit/>
<w:trHeight w:val="346"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="643" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRDefault="003460A1" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepNum"/>
</w:pPr>
<w:r>
<w:t><xsl:value-of select="position()"/></w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3497" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRDefault="003460A1" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepField"/>
</w:pPr>
<w:r>
<w:t><xsl:value-of select="Description" disable-output-escaping="yes"/></w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3240" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRDefault="003460A1" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepField"/>
</w:pPr>
<w:r>
<w:t><xsl:value-of select="ExpectedResult" disable-output-escaping="yes"/></w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2520" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003460A1" w:rsidRDefault="0074690E" w:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepField"/>
</w:pPr>
<w:r>
<w:t><xsl:value-of select="SampleData" disable-output-escaping="yes"/></w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<!-- End of Test Step Row Output -->
</xsl:for-each>
</xsl:if>
</xsl:template>
<xsl:template name="EndOfTestCaseParagraph">
<w:p w:rsidR="00692B5F" w:rsidRDefault="00692B5F" w:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p w:rsidR="00692B5F" w:rsidRPr="00622D51" w:rsidRDefault="00692B5F" w:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p w:rsidR="00D839E4" w:rsidRDefault="0020781F"/>
<w:sectPr w:rsidR="00D839E4" w:rsidSect="00314F5D">
<w:pgSz w:w="12240" w:h="15840"/>
<w:pgMar w:top="1440" w:right="1350" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
<w:cols w:space="720"/>
<w:docGrid w:linePitch="360"/>
</w:sectPr>
</xsl:template>

</xsl:stylesheet>
Tuesday, December 8, 2015
Avatar
re: inflectra.sarahx Monday, December 7, 2015
After a bit more research into the 2003 ml piece - I created another template...  But I'm still having the same issue - no table...

It seems like I have everything constructed correctly as the XSLT is valid using XMLSpy.  Can you see anything glaring that I'm doing wrong???

Thanks,
Brian


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
exclude-result-prefixes="msxsl"
xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" 
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:o="urn:schemas-microsoft-com:office:office" 
xmlns:v="urn:schemas-microsoft-com:vml" 
xmlns:w10="urn:schemas-microsoft-com:office:word" 
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" 
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" 
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" 
xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2" 
xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" 
w:macrosPresent="no" 
w:embeddedObjPresent="no" 
w:ocxPresent="no" 
xml:space="preserve"> 
<w:ignoreSubtree w:val="http://schemas.microsoft.com/office/word/2003/wordml/sp2"/>

<w:styles>
<w:style w:type="table" w:styleId="TableGrid">
<w:name w:val="Table Grid"/>
<w:basedOn w:val="TableNormal"/>
<w:rsid w:val="00692B5F"/>
<w:rPr>
<wx:font wx:val="Calibri"/>
</w:rPr>
<w:tblPr>
<w:tblBorders>
<w:top w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:left w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:bottom w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:right w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:insideH w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:insideV w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
</w:tblBorders>
</w:tblPr>
</w:style>
<w:style w:type="character" w:styleId="Heading1Char">
<w:name w:val="Heading 1 Char"/>
<w:link w:val="Heading1"/>
<w:rsid w:val="00542C17"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:b-cs/>
<w:sz w:val="28"/>
<w:sz-cs w:val="28"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestCaseDesc">
<w:name w:val="TestCaseDesc"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:before="120" w:after="0"/>
<w:ind w:left="360" w:hanging="360"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestCaseTitle">
<w:name w:val="TestCaseTitle"/>
<w:basedOn w:val="Heading1"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:tabs>
<w:tab w:val="left" w:pos="180"/>
</w:tabs>
<w:spacing w:before="120"/>
<w:ind w:left="-360"/>
</w:pPr>
<w:rPr>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestTableClassTop">
<w:name w:val="TestTableClassTop"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
<w:b/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestTableClassBottom">
<w:name w:val="TestTableClassBottom"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
<w:jc w:val="right"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
<w:b/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestTableColHeader">
<w:name w:val="TestTableColHeader"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
<w:b/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestColHeaderStepNum">
<w:name w:val="TestColHeaderStepNum"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
<w:b/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestTableColHeaderCheck">
<w:name w:val="TestTableColHeaderCheck"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:rPr>
<wx:font wx:val="Calibri"/>
<w:sz w:val="20"/>
<w:lang w:fareast="KO"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestTableStepField">
<w:name w:val="TestTableStepField"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:before="40" w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestTableStepNum">
<w:name w:val="TestTableStepNum"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:before="40" w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TestTableStepCheck">
<w:name w:val="TestTableStepCheck"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="004F7FE1"/>
<w:pPr>
<w:spacing w:before="40" w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="TableHeaderTestSteps">
<w:name w:val="TableHeaderTestSteps"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="00437DB3"/>
<w:pPr>
<w:spacing w:before="120" w:after="60"/>
<w:jc w:val="center"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:style>
</w:styles>
 
<xsl:template match="/TestRunData">
    <w:wordDocument>
<w:body>

<w:p wsp:rsidR="00692B5F" wsp:rsidRPr="00622D51" wsp:rsidRDefault="00692B5F" wsp:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:sz w:val="28"/>
</w:rPr>
<w:t>Test Cases in Report = <xsl:value-of select = "count(//TestRun)" /></w:t>
</w:r>
</w:p>
<w:p w:rsidR="002D122E" w:rsidRDefault="002D122E" w:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:sz w:val="28"/>
</w:rPr>
</w:pPr>
</w:p>


<xsl:for-each select="TestRun">
<br />
<br style="page-break-after : always"></br>

<!-- Test Case Title Paragraph -->
<w:p wsp:rsidR="00692B5F" wsp:rsidRPr="00542C17" wsp:rsidRDefault="00F32F5B" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestCaseTitle"/>
</w:pPr>
<w:r wsp:rsidR="00692B5F" wsp:rsidRPr="00542C17">
<w:t xml:space="preserve">
<xsl:variable name="TCId" select="TestCaseId"/>
<xsl:value-of select="Name"/><xsl:text> :: </xsl:text> (TC:<xsl:value-of select='format-number($TCId,"000000")'/>)
</w:t>
</w:r>
</w:p>
<w:p wsp:rsidR="00692B5F" wsp:rsidRPr="00622D51" wsp:rsidRDefault="008764A6" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestCaseDesc"/>
</w:pPr>
<w:r wsp:rsidR="00692B5F" wsp:rsidRPr="00622D51">
<w:t xml:space="preserve"><xsl:value-of select="Description" disable-output-escaping="yes"/></w:t>
</w:r>
</w:p>
<!-- Paragraph for Table Label -->
<w:p wsp:rsidR="00692B5F" wsp:rsidRPr="00622D51" wsp:rsidRDefault="00437DB3" wsp:rsidP="00437DB3">
<w:pPr>
<w:pStyle w:val="TableHeaderTestSteps"/>
</w:pPr>
<w:r>
<w:t xml:space="preserve">Table <xsl:value-of select="position()" />:  Test Case Steps</w:t>
</w:r>
</w:p>
<!--  End of Table Label Paragraph -->
<!--  Table Size Definition -->
<w:tbl>
<w:tblPr>
<w:tblW w:w="9900" w:type="dxa"/>
<w:tblInd w:w="-162" w:type="dxa"/>
<w:tblBorders>
<w:top w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:left w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:bottom w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:right w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:insideH w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:insideV w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
</w:tblBorders>
<w:tblLook w:val="04A0"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="643"/>
<w:gridCol w:w="3497"/>
<w:gridCol w:w="3240"/>
<w:gridCol w:w="2520"/>
</w:tblGrid>
<!-- Start Table Rows -->
<w:tr wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidTr="003C469D">
<w:trPr>
<w:cantSplit/>
<w:trHeight w:val="432"/>
<w:tblHeader/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="643" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="003460A1" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestColHeaderStepNum"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>Step</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3497" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="00AA62D3" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableColHeader"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>Step </w:t>
</w:r>
<w:r wsp:rsidR="0074690E" wsp:rsidRPr="003C469D">
<w:t>Description</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3240" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="003460A1" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableColHeader"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>Expected Result</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2520" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="A6A6A6"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="0074690E" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableColHeader"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>Comment</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<!-- End Table Header Row -->
<xsl:call-template name="display-testrunsteps">
<xsl:with-param name="TestRunId" select="TestRunId" />
</xsl:call-template>
</w:tbl>

</xsl:for-each>

<xsl:call-template name="EndOfTestParagraph"></xsl:call-template>

  </w:body>
</w:wordDocument>
</xsl:template>


<xsl:template name="display-testrunsteps">
<xsl:param name="TestRunId" />

<xsl:if test="/TestRunData/TestRunStep[TestRunId=$TestRunId]">
<xsl:for-each select="/TestRunData/TestRunStep[TestRunId=$TestRunId]">
<!-- Start of Test Step Row Output -->
<w:tr wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidTr="003C469D">
<w:trPr>
<w:cantSplit/>
<w:trHeight w:val="346"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="643" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="003460A1" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepNum"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>1</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3497" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="003460A1" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepField"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>First step text.</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="3240" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="003460A1" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepField"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>First Expected Result</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2520" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="003460A1" wsp:rsidRPr="003C469D" wsp:rsidRDefault="0074690E" wsp:rsidP="004F7FE1">
<w:pPr>
<w:pStyle w:val="TestTableStepField"/>
</w:pPr>
<w:r wsp:rsidRPr="003C469D">
<w:t>Step Comment</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<!-- End of Test Step Row Output -->
</xsl:for-each>
</xsl:if>
</xsl:template>
<!-- End of Test Step Table -->

<!-- Add a paragraph after table -->
<xsl:template name="EndOfTestParagraph">
<w:p wsp:rsidR="00692B5F" wsp:rsidRDefault="00692B5F" wsp:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p wsp:rsidR="00692B5F" wsp:rsidRPr="00622D51" wsp:rsidRDefault="00692B5F" wsp:rsidP="00692B5F">
<w:pPr>
<w:spacing w:after="0"/>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman"/>
<wx:font wx:val="Times New Roman"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p wsp:rsidR="00D839E4" wsp:rsidRDefault="003C469D"/>
<w:sectPr wsp:rsidR="00D839E4" wsp:rsidSect="00314F5D">
<w:pgSz w:w="12240" w:h="15840"/>
<w:pgMar w:top="1440" w:right="1350" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
<w:cols w:space="720"/>
<w:docGrid w:line-pitch="360"/>
</w:sectPr>
</xsl:template>

</xsl:stylesheet>
Friday, December 11, 2015
Avatar
re: bkstigler Tuesday, December 8, 2015
Hi Brian

This is Adam here. I would probably send us a help desk ticket if you need us to help you with this (forums better for general information).

For those reading this thread, you can get details on the MS-Word 2003 XML (WordML) format here - http://blogs.msdn.com/b/brian_jones/archive/2005/07/05/intro-to-word-xml-part-1-simple-word-document.aspx

Regards

Adam

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Friday, December 4, 2015
  • Last Reply: Friday, December 11, 2015
  • Replies: 4
  • Views: 10235