Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2006, 11:11 PM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Two HTML Tables and Two XSLT with Two XML?

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>

 
Old March 1st, 2006, 04:53 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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)





Similar Threads
Thread Thread Starter Forum Replies Last Post
html to xml convertion using xslt moshaik BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 2 November 24th, 2008 10:33 AM
XSLT help : Interpretting HTML tags from XML kunal_kishan XSLT 1 June 26th, 2006 05:37 AM
constructing a HTML table from xml data using xslt rameshnarayan XSLT 0 September 19th, 2005 06:53 AM
XSLT and tables surgeon XSLT 1 July 3rd, 2005 03:36 AM
Add XSLT transformed XML (html) on an aspx page humour XSLT 2 September 30th, 2004 05:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.