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

invoking nodes from multiple XML files

Subject: invoking nodes from multiple XML files
From: chun ji <cji_work@xxxxxxxxx>
Date: Tue, 28 Nov 2006 14:08:46 -0800 (PST)
 invoking nodes from multiple XML files
I have 10 XML files, test1.xml, test2.xml, ...
test10.xml. Each contains the results of my
test-cases. 

This is test1.xml looks like:  
" 
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<suites>
     <suite thread-count="5" verbose="2"
name="billing" parallel="null" annotations="JDK5&quot;>
             <test
name="test.domain.billing.MspBillingConfigTest"
junit="true">
                   <completed>OK</completed>
                    <total>4</total>
                    <passed>4</passed>
                    <failed>0</failed>
                    <skipped>0</skipped>
            </test>
            <test
name="test.domain.billing.MealExpenseTest"
junit="true">
                   <completed>OK</completed>
                   <total>4</total>
                   <passed>3</passed>
                   <failed>1</failed>
                   <skipped>0</skipped>
           </test>
           ....
     <suite>
<suites>
". 

The name of each test node is unique, of all these 10
XML files. And I have created a "test.xsl" file, which
can display each individual XML file in html format. 

here is my "test.xsl" file  
" 
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
version="1.0">

<xsl:template match="/">
  <html>
  <body>
    <table boarder="2" width="60%">
       <tr>
        <td align="left" ><font size="5"><strong>Test
Results.</strong></font>(testlog.html)
          <xsl:element name="a">
                <xsl:attribute
name="href">testlog.html</xsl:attribute>
                <xsl:attribute
name="target">classFrame</xsl:attribute>
          </xsl:element>
        </td>
      </tr>
    </table>
    <table boarder="2">
      <tr>
        <th bgcolor="#ccccff" align="center">TEST</th>
        <th bgcolor="#ccccff"
align="center">Completed</th>
        <th bgcolor="#ccccff"
align="center">TOTAL</th>
        <th bgcolor="#ccccff"
align="center">Passed</th>
        <th bgcolor="#ccccff"
align="center">Failed</th>
        <th bgcolor="#ccccff"
align="center">Skipped</th>
      </tr>
      <xsl:for-each select="suites/suite/test">
         <xsl:sort select="@name"/>
      <tr>
        <td  align="left" bgcolor="#BFC1CC">
         <b>
           <xsl:element name="a">
             <xsl:attribute name="href"><xsl:value-of
select="/suites/suite/@name"/>/<xsl:value-of
select="@name"/>.html</xsl:attribute>
             <xsl:attribute
name="target">classFrame</xsl:attribute>
             <xsl:value-of select="@name"/>
           </xsl:element>
           </b>
           <xsl:if test="name
='test.domain.billing.PurchaseOrderTest'">
                (w/ -javaagent)
           </xsl:if>
        </td>
        <td  align="center"
bgcolor="#BFC1CC"><xsl:value-of
select="completed"/></td>
        <td  align="center"
bgcolor="#BFC1CC"><xsl:value-of select="total"/></td>
        <td  align="center"
bgcolor="#BFC1CC"><xsl:value-of select="passed"/></td>
        <xsl:choose>
          <xsl:when test="failed &gt; 0">
              <td  align="center"
bgcolor="FF0000"><xsl:value-of select="failed"/></td>
          </xsl:when>
          <xsl:otherwise>
              <td  align="center"
bgcolor="#BFC1CC"><xsl:value-of select="failed"/></td>
          </xsl:otherwise>
        </xsl:choose>
        <td  align="center"
bgcolor="#BFC1CC"><xsl:value-of
select="skipped"/></td>
      </tr>
     </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
" 

As you can see from the browser, the test results are
listed in a table format

The question I have is how can I merge all the test
results from these 10 XML files and put them in one
html file ? 
 
Thanks for the tips !


cji 



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.