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 September 6th, 2007, 01:27 PM
Authorized User
 
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ignoring in False clause?

Hi All!

I have a very delicate situation. Take for example the XML page:

http://www.mamaliga.com/onlineschedu...s_3_months.xml

and click on the "1 Available" link. You will be displayed with an AM and a PM time slots columns. The problem is that I don't know how to get the PM time slot to start up at the top. They always are displayed from where the AM slots end.

I believe it has something to do with ignoring the values that don't meet the true value for each xsl:if statements in the AM and PM templates at the bottom in the stlesheet...

Here is the stylesheet:

http://www.mamaliga.com/onlineschedu...s_3_months.xsl

Thanks!
Gabi.

 
Old September 6th, 2007, 05:22 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>and click on the "1 Available" link

For the benefit of anyone else trying this, it doesn't do anything in Firefox, you need to find your long-forgotten copy of Internet Explorer.

As you could easily see if you inspect the HTML that you're generating as source HTML, rather than just looking it in the browser (which is a *really* bad way of debugging), you're generating an invisible "<a href=""><br/>" in the PM column for every time that isn't a PM time. You could solve that by moving the xsl:if to the outermost level of the template rule. But I would tackle this quite differently:

<td valign="top" bgcolor="#FFFF99">
  <xsl:apply-templates select="Time[contains(@slot, 'am')]"/>
</td>
<td valign="top" bgcolor="#CCFFFF">
  <xsl:apply-templates select="Time[contains(@slot, 'pm')]"/>
</td>

then

<xsl:template match="Time">
  <a class="Item" href="{@href}">
    <xsl:value-of select="@slot"/>
  </a>
  <br/>
</xsl:template>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 7th, 2007, 08:29 AM
Authorized User
 
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Michael!!!!

You are ABSOLUTELY FANTASTIC!!! You made my day! Seriously, no kidding! IT WORKS!

This comes with a question. I am usually working with XML Spy as an editor, and visualizing everything in the retarded Internet Explorer - where debuging is imposibble because of their stupid "The XML source is unavailable for viewing" message.
Is there an elegant way of visualising/debugging OTHER than Internet Explorer by any way? Any suggestions on maybe other browsers or MDIs?

Thanks again!!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Ignoring first element using for-each amhicraig XSLT 1 December 4th, 2007 05:41 PM
my stylesheet is ignoring nodes gonzalocordero XSLT 8 June 30th, 2006 09:17 PM
Ignoring Namespace Pt2 Chamkaur XSLT 1 June 19th, 2006 05:08 AM
Calculated Member - Ignoring Decimal brian312 SQL Server 2000 1 May 9th, 2006 02:37 AM
Ignoring nulls in stored proc 12th_Man SQL Language 4 June 17th, 2004 02:11 PM





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