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 March 31st, 2009, 08:40 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default xsl:function pass param to attribute of xsl:instruction

Hi,

Is it possible to pass a param with a type element() to an attribute of an xsl instruction?

for example:
Code:
<xsl:function name="f:getFigNum">
        <xsl:param name="parent" as="element()"/>
        <xsl:number level="any" count="//figure" from="{$parent}"/>
</xsl:function>
This gives me an Unexpected token in XMLspy -

Thanks,
 
Old March 31st, 2009, 08:45 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

The from attribute of xsl:number takes a pattern. It is not an attribute value template so the curly braces {} are not allowed in there.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
 
Old March 31st, 2009, 08:52 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Hi,

Removing the curly brackets gives the same error in xmlspy and Saxon. is it possible to pass a value to the @from attribute?

thx
 
Old March 31st, 2009, 09:00 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

No, the from attribute is a pattern, as is the match attribute of xsl:template (for instance). So you can't do
<xsl:template match="$var">
and you can't do
<xsl:number from="$var"/>
that is not allowed.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
 
Old March 31st, 2009, 09:06 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thank you very much





Similar Threads
Thread Thread Starter Forum Replies Last Post
xsl:param and xsl:apply-templates' "select" newbieboobers XSLT 1 March 25th, 2008 07:23 PM
Pass xsl:param to xsl:if bonekrusher XSLT 5 September 6th, 2007 04:37 PM
xsl:variable holding name of an xsl:param perissos XSLT 0 December 5th, 2006 07:09 AM
The difference between xsl:variable and xsl:param NEO1976 XML 2 July 24th, 2006 06:05 AM
XSL Parameter xsl:param Harinath Chikoti XSLT 1 May 6th, 2005 03:15 AM





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