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 November 1st, 2006, 11:37 AM
dep dep is offline
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dep
Default Why would this skip record #1?

Code:
<xsl:variable name="thisSet" select="substring(@series, 0, 7)"/>

<xsl:for-each select="following-sibling::*[substring(@series, 0, 7) = $thisSet]">

in this case, thisSet = "Nov 06"
So yes, if there are 5 matching records, it only displays 2-5. How can I tweak this to display all five?

dep



 
Old November 1st, 2006, 12:24 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You seem to have forgotten to include any information about the data you are working on.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 1st, 2006, 12:30 PM
dep dep is offline
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dep
Default

here is the XML i'm working with...
http://www.pecknology.net/storage/ss.gif
 
Old November 1st, 2006, 12:33 PM
dep dep is offline
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dep
Default

Code:
    <xsl:for-each select="following-sibling::*[substring(@series, 0, 7) = $thisSet]">
        <xsl:choose><xsl:when test="@callBid"><xsl:value-of select="@callBid"/></xsl:when><xsl:otherwise>--</xsl:otherwise></xsl:choose>
    </xsl:for-each>
 
Old November 1st, 2006, 01:28 PM
dep dep is offline
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dep
Default

I really hate XSLT.

 
Old November 1st, 2006, 01:46 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Actually, you give me the impression that you really hate programming. Perhaps you're having an off day, but you certainly don't seem to be taking a systematic approach to analyzing your problem and describing it clearly.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 1st, 2006, 01:58 PM
dep dep is offline
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dep
Default

Well, our XSLT expert is on vacation this week. I'm trying to dissect his code and figure it out so I can fix his bug... I'm more the DHTML, Javascript guy...

Do you have any idea what I'm doing wrong? Or what more information I could provide to help?


 
Old November 1st, 2006, 02:37 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

From your description, I haven't the faintest idea what's wrong. Your snippets of code are meaningless because there's no information about the input document and no context - XPath expressions are very sensitive to context, and many bugs arise from getting the context wrong.

I don't even know what you mean by "record". There's no such thing in XML.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 1st, 2006, 02:57 PM
dep dep is offline
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dep
Default

I'm afraid I just don't know enough about it to form the right question.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to skip errors absu ADO.NET 1 October 6th, 2008 09:56 AM
skip first field gilgalbiblewheel Classic ASP Databases 1 July 7th, 2007 05:10 PM
how to skip from one page to other rashmipant PHP How-To 2 December 8th, 2006 05:20 AM
Skip a row rochak SQL Server DTS 2 September 27th, 2005 11:06 PM
Skip On Refresh Prabhakar_dt Classic ASP Basics 9 September 2nd, 2004 11:44 PM





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