Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 28th, 2006, 11:11 PM
Registered User
 
Join Date: Feb 2006
Location: , , .
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>

Reply With Quote
  #2 (permalink)  
Old March 1st, 2006, 04:53 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.