Subject: Two HTML Tables and Two XSLT with Two XML?
Posted By: gman44 Post Date: 2/28/2006 10:11:59 PM
I cannot find anyone who can solve this problem. I've been everywhere too.

I have one DataSet.xsd with two tables and two .xml files, each table has it's own seperate xml.

DataSet1.xsd ------- datatable1 ---- datatable1.xml
                 ^------- datatable2 ---- datatable2.xml

Now, using the code above and applying your advice, the code below should look like this???

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:tbl="http://tempuri.org/DataSet1.xsd" exclude-result-prefixes="tbl">
  
<xsl:template match="/">
  <html>
    <head>
        <title>Customers</title>
      </head>
    <body>
      <h1 style=" font-family:arial; font-size:12pt; font-weight:bold; text-align:left;">Customers:</h1>
      <table border="1" style="width:100%">
        <thead>
          <tr style =" font-family:arial; font-size:10pt; font-weight:bold; text-align:center; background-color:FAF8CC; cell-padding:10px">
            <td>Date/Time</td>
            <td>First Name</td>
            <td>Last Name</td>
            <td>Gender</td>
            <td>Age</td>                                         
          </tr>
        </thead>
        <xsl:apply-templates/>
        <p></p>
      </table>
      
      <h1 style=" font-family:arial; font-size:12pt; font-weight:bold; text-align:left;">Jobs:</h1>
      <table border="1" style="width:100%">
        <thead>
          <tr style =" font-family:arial; font-size:10pt; font-weight:bold; text-align:center; background-color:FAF8CC; cell-padding:10px">
            <td>Date/Time</td>
            <td>Current</td>
            <td>Past</td>
          </tr>
        </thead>
        <xsl:apply-templates select="document('tableinfo.xml')//DataSet1"/>
      </table>
    </body>
  </html>
</xsl:template>

<xsl:template match="tbl:tablecustomers">    
   <tr style =" font-family:arial; font-size:10pt; font-weight:normal; text-align:left; background-color:FFFFFF; cell-padding:10px">
     <td>
       <xsl:value-of select="tbl:datetime"/>
     </td>
     <td>
       <xsl:value-of select="tbl:firstname"/>
     </td>
     <td>
       <xsl:value-of select="tbl:lastname"/>
     </td>
     <td>
       <xsl:value-of select="tbl:gender"/>
     </td>
     <td>
       <xsl:value-of-select="tbl:age"/>
     <td>
   </tr>
</xsl:template>

<xsl:template match="tbl:primarykey"/>


<xsl:template match="tbl:tableinfo">     
   <tr style =" font-family:arial; font-size:10pt; font-weight:normal; text-align:left; background-color:FFFFFF; cell-padding:10px">
     <td>
       <xsl:value-of select="tbl:datetime"/>
     </td>
     <td>
       <xsl:value-of select="tbl:current"/>
     </td>
     <td>
       <xsl:value-of select="tbl:past"/>
     </td>             
   </tr>
</xsl:template>
<xsl:template match="tbl:primarykey"/>
</template>

Reply By: joefawcett Reply Date: 3/1/2006 3:53:59 AM
What are you trying to do?
Are you trying to create a stylesheet that will process the XSD and XML for one of the tables or both at the same time?

What exactly is the problem, you haven't said?
Can you show a small sample of the XSD and XML for one of the tables, or both if the straucture is radically different?

--

Joe (Microsoft MVP - XML)

Go to topic 40770

Return to index page 356
Return to index page 355
Return to index page 354
Return to index page 353
Return to index page 352
Return to index page 351
Return to index page 350
Return to index page 349
Return to index page 348
Return to index page 347