[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Dynamic Index?

Subject: Dynamic Index?
From: "Edlavitch, Ben" <Ben.Edlavitch@xxxxxxxx>
Date: Wed, 7 Mar 2001 13:39:19 -0800
dynamic index
Hello All,

I am trying to create an index.html file that is created by applying
testfile.xml to index.xsl through a cocoon processor.  After the index.html
is created there should be a list of links that go to a "details" document.
The "details" document is created by parsing: testfile.xml to an XSLT
Producer called MSDWProducer using a variable $testsuite_name.  This
variable $testsuite_name passed to detail.xsl should indicate the node from
the testfile.xml that should be rendered using detail.xsl and the cocoon
processor.

Below I have attemped to write a testfile.xml, index.xsl, and detail.xsl
that produces an index.html file that has the functionality described above.
I am aware that some of my code in incorrect, that is why I am asking for
help.

Thank you,
Ben



####################### testfile.xml ################################

<?xml version="1.0"?>
<?xml-stylesheet href="index.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<all-junit-reports>
 <testsuite name="test.com.msdw.online.aba.MetroBatchLoadTestSuite"
tests="1" failures="1" errors="0" time="2.654 sec">
 </testsuite>
 <testsuite
name="test.com.msdw.online.controller.financialadvisor.FinancialAdvisorCtrlT
estSuite" tests="1" failures="0" errors="0" time="2.674 sec">
 </testsuite>
 <testsuite name="test.com.msdw.online.controller.user.UserCtrlTestSuite"
tests="1" failures="1" errors="0" time="2.273 sec">
 </testsuite>



####################### index.xsl ################################

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
     <html>
     <head><title>JUnit Test Cases Report</title></head>
     <body>
     <H1 class="contentTitle">JUnit Test Cases Report</H1>
     <table>
     <xsl:for-each select="all-junit-reports/testsuite">
        <tr>
           <td>
              <A>
                <xsl:attribute
name="HREF">testfile.xml?producer=MSDWProducer&XSL=detail.xsl&$testsuite_nam
e=<xsl:value-of select="@name"/>
                </xsl:attribute>
                <xsl:value-of select="@name"/>
              </A>
           </td>     
         </tr>
      </xsl:for-each>
      </table>
      </body>
      </html>
   </xsl:template>
</xsl:stylesheet>     



####################### detail.xsl ################################

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name="$testsuite_name"/>
<xsl:template match="/">
    <html>
    <head><title>Nightly Build</title></head>
    <body class="contentFrame" link="black" vlink="red" alink="red">
    <table>
      <tr>
       <td>
	<p><font face="helvetica">
          <xsl:apply-templates
select="all-junit-reports/testsuite[@name='test.com.msdw.online.aba.MetroBat
chLoadTestSuite']"/>
        </font></p>
       </td>
      </tr>
     </table>
     </body>
     </html>	
</xsl:template>
<xsl:template match="all-junit-reports/testsuite[@name='$testsuite_name']">
     <H1 class="contentTitle">Nightly Build Reports</H1>
     <FIELDSET>
     <LEGEND>TEST SUITE INFO:</LEGEND>
     <table width="100%">
      <tr>
       <td>
        <font size="2"><b>NAME:</b></font>
       </td>
       <td>
        <font size="2"><xsl:value-of select="@name"/></font></td></tr>
      <tr>
       <td>
        <font size="2"><b>TESTS:</b></font>
       </td>
       <td>
        <font size="2"><xsl:value-of select="@tests"/></font>
       </td>
      </tr>
     </table>
</xsl:template> 
</xsl:stylesheet>
  
        



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.