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 August 19th, 2010, 10:51 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 109
Thanks: 18
Thanked 0 Times in 0 Posts
Default xsl:sequence not doing what I thought it would

I am using Saxon 9 and my 3rd edition of XSLT 2.0 is looking mighty dog-eared :)

I must be interpreting the passages (paraphrased):
Quote:
The <xsl:sequence> element is used to deliver an arbitrary sequence[..]. It is [one of] the only XSLT function(s) [..] that can return references to existing nodes [..].
to mean what I'd like them to mean, rather than what they really mean. That, or I'm just using <xsl:sequence> incorrectly.

I would like to replace:

Code:
<xsl:variable name="myPMTable" select="$repoSubTree//pmtable[./pmtitle/@Id eq $myIDRef]"/>
with:
Code:
<xsl:variable name="myPMTable" select="nmirepo:findPMTable($repoSubTree, $myIDRef)"></xsl:variable>
and use:
Code:
    <xsl:function name="nmirepo:findPMTable">
        <xsl:param name="basenode"></xsl:param>
        <xsl:param name="idref"></xsl:param>
        
        <xsl:sequence select="$basenode//pmtable[./pmtitle/@Id eq idref]"/>
    </xsl:function>
as the function so I can use it is multiple places in the stylesheet, and in other stylesheets.

Seems logical to me, returning a reference to existing nodes. But I don't get anything back from the function. Certainly not a pointer to the table I'm looking for.

So, what am I missing with <xsl:sequence>?

Thanks,
__________________
------------------------
Keep Moving Forward

GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876

Michael Hare

Last edited by mphare; August 19th, 2010 at 10:55 AM..
 
Old August 19th, 2010, 11:03 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Might it simply be that you are missing a '$' in front of idref?

Code:
<xsl:sequence select="$basenode//pmtable[./pmtitle/@Id eq $idref]"/>
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
mphare (August 19th, 2010)
 
Old August 19th, 2010, 11:07 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 109
Thanks: 18
Thanked 0 Times in 0 Posts
Default

Well, that's twice in one week.
I think I need a vacation. I'm looking at this stuff cross-eyed.

Thanks!
__________________
------------------------
Keep Moving Forward

GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876

Michael Hare





Similar Threads
Thread Thread Starter Forum Replies Last Post
RowSpan not working like I thought MLaGrange ASP.NET 2.0 Basics 0 February 20th, 2006 10:13 AM
value from a sequence suhabassam JSP Basics 0 September 27th, 2005 01:33 AM
Building a simple form - I thought misterqj Access 3 April 27th, 2004 01:07 PM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





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