I finally figured it out. In case anyone is interested, here is a snippet 
from my WebTestReport.xsl:

Basically, anytime it finds the string "lineBreak," it will insert a 
<br/>.

    <!-- Special representation for the <testInfo .../> steps if any -->
    <xsl:template name="displayTestInfo">
      <xsl:if test=".//st...@taskname = 'testInfo']">
        <div class="testInfo">
          <div class="testInfoTitle">Test info</div>
          <ul class="testInfo"> 
            <xsl:for-each select=".//st...@taskname = 'testInfo']">
              <xsl:choose>
                <xsl:when test="paramet...@name = 'type' and 
@value='reportLink']">
                  <li>
                    <b>
                      <xsl:value-of select="paramet...@name = 
'type']/@value"/>
                      <xsl:text>:&space;</xsl:text>
                    </b>
                    <a>
                      <xsl:attribute name="href">
                        <xsl:value-of select="paramet...@name = 
'info']/@value"/>
                      </xsl:attribute>
                      <xsl:text>There was an error. Click this to see the 
page.
                        <!-- <xsl:value-of select="paramet...@name = 
'nested text']/@value"/> -->
                      </xsl:text> 
                    </a>
                  </li>
                </xsl:when>
                <xsl:otherwise>
                    <li>
                      <b>
                        <xsl:value-of select="paramet...@name = 
'type']/@value"/>
                        <xsl:text>:&space;</xsl:text>
                      </b>
                      <xsl:call-template name="SplitText">
                        <xsl:with-param name="inputString" 
select="paramet...@name = 'info']/@value"/>
                      </xsl:call-template>
                    </li>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:for-each>
          </ul>
        </div>
      </xsl:if>
    </xsl:template>

    <xsl:template name="SplitText">
      <xsl:param name="inputString"/>
      <xsl:choose>
        <xsl:when test="contains($inputString, 'lineBreak')">
          <xsl:value-of select="substring-before($inputString, 
'lineBreak')"/>
          <br/>
          <xsl:call-template name="SplitText">
            <xsl:with-param name="inputString" 
select="substring-after($inputString,'lineBreak')"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="$inputString = ''">
              <xsl:text></xsl:text>
            </xsl:when>
            <xsl:otherwise>
              <p>
                <xsl:value-of select="$inputString"/>
                <xsl:text> </xsl:text>
              </p>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>


Kelcy Monday



A Vander <[email protected]> 
Sent by: [email protected]
07/01/2009 11:26 AM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: [Webtest] WebTestReport.xsl -- add template to parse out line breaks 
for <testInfo> step







Maybe this will get you started, I just added an apply-templates to 
reprocess
the testInfo step after the standard one so I can catch the info an add
something to the report, see the lines with "myTurn".

Piece of WebTestreport.xsl ( I'm using wt 3.0):
...
    <!-- Special representation for the <testInfo .../> steps if any -->
    <xsl:template name="displayTestInfo">
        <xsl:if test=".//st...@taskname = 'testInfo']">
            <div class="testInfo">
                <div class="testInfoTitle">Test info</div>
                <ul class="testInfo">
                                 <xsl:for-each select=".//st...@taskname = 
'testInfo']">
 <li>
  
       <xsl:value-of select="paramet...@name =
'type']/@value"/>
       <xsl:text>:&space;</xsl:text>
  
   <xsl:value-of select="concat(paramet...@name =
'info']/@value, paramet...@name = 'nested text']/@value)"/>
 </li>
                                 </xsl:for-each>
 
                                 <xsl:apply-templates 
select=".//st...@taskname =
'testInfo']" mode="myTurn"/>
                </ul>
            </div>
        </xsl:if>
    </xsl:template>
 
    <xsl:template match="st...@taskname = 'testInfo']" mode="myTurn">
                 <p>myTurn to say something about testinfo: <xsl:value-of
select="paramet...@name = 'type']/@value" /></p>
    </xsl:template>
...

Hope this helps, 

Avander
-- 
View this message in context: 
http://www.nabble.com/WebTestReport.xsl----add-template-to-parse-out-line-breaks-for-%3CtestInfo%3E-step-tp24272543p24291785.html

Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to