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 May 5th, 2006, 08:33 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default rollovers in xslt

I am trying to find out how to do a rollover in xslt.

 
Old May 5th, 2006, 08:41 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

XSLT transforms XML to a different format, it has no visible properties so cannot do rollovers.
What are you trying to do?

--

Joe (Microsoft MVP - XML)
 
Old May 5th, 2006, 08:42 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I don't know how you do a rollover in anything except a canoe.

Could you explain, by showing specimen input and output, and indicating how they relate?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 5th, 2006, 09:10 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry I didn't give you enough info. This is very new to me. Here is my code. I'm trying to insert a rollover image using a xsl stylesheet.

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="html"/>
  <xsl:template match="/">
    <table width="500" border="1" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC">
      <tbody>
              <tr>
          <th>
            <p align="left">
              Go Back
            </p>
          </th>
          <th>
            <p align="left">
              Sections
            </p>
          </th>
          <th>
            <p align="left">
              Complete
            </p>
          </th>
          <th>
            <p align="left">
              Score
            </p>
          </th>
                  </tr>
        <xsl:apply-templates select="NewDataSet/Table"/>
      </tbody>
    </table>
  </xsl:template>
  <xsl:template match="Table">
    <tr>
      <td width="70" align="center">
        <p>

           <xsl:if test="OLQ_SECTIONDONE [.!= 'Off']">
           <a>
             <xsl:attribute name="href">
               http://64.26.133.147/Dev/NewLinx/LMSCourseLaunch.php?UserID=" + <xsl:value-of select="OLQ_CLI_RID"/> + "#38;CourseID=" + <xsl:value-of select="OLQ_CLUSTERID"/>
             </xsl:attribute>
             <xsl:attribute name="target">_parent</xsl:attribute>
             <img src="{OLQ_GOTO}" alt="Arrow" title="Go To" border="0"/>
           </a>
           </xsl:if>
           <xsl:if test="OLQ_GOTO = 'Off'">
             <img src="images/Blank.gif" />
           </xsl:if>


        </p>
      </td>
      <td>
        <p>

            <xsl:value-of select="OLQ_TITLE"/>

        </p>
      </td>
      <td width="50" align="center">
        <p>

            <img src="{OLQ_SECTIONDONE}" alt="Check mark" title="Done" />

        </p>
      </td>
      <td width="50" align="center">
        <p>

            <xsl:value-of select="OLQ_SCORE"/>%

        </p>
      </td>
          </tr>
  </xsl:template>
  <xsl:template match="STATE"/>
</xsl:stylesheet>


 
Old May 5th, 2006, 09:32 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You must get clear in your mind how the process works:
 
  • You load XML
  • You load an XSLT
  • The XML is transformed by the XSLT to HTML

At this point the HTML has no knowledge of how it came to be; there's no point creating conditional logic in the XSLT to guide the HTML.

You need to produce the HTML, by hand, that gives you what you want, then go backwards a step and try to produce that given your source XML.

If you show a sample of the image and rollover you want and the relevant portion of the source XML we can probably help.

--

Joe (Microsoft MVP - XML)
 
Old May 5th, 2006, 10:00 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Very pretty code. Does it work?

Seriously: I'm having trouble knowing what your problem is. What does your input look like, and what HTML are you trying to generate? Where exactly are you stuck? Do you actually know what HTML you want your stylesheet to generate as its output? (if you don't, then writing the code is likely to be tricky)

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
rollovers in css john txforthehelp CSS Cascading Style Sheets 2 May 2nd, 2006 05:33 PM
CSS Rollovers Using JScript in IE 6.0 Problem kwilliams Other Programming Languages 1 March 1st, 2006 01:20 PM
Rollovers not working Adam H-W Javascript 9 April 24th, 2004 09:30 AM
interesting problem - re: database & rollovers highbeef Classic ASP Databases 4 March 2nd, 2004 09:41 AM





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