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 27th, 2008, 03:37 PM
Registered User
 
Join Date: Aug 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using param/variable to copy attributes

I am trying to transform xhtml and replace action of the form, however I would like to pass the original action url as another input parameter. I tried:
  <xsl:param name="callbackOriginalActionUrl"/>
...
      <xsl:attribute name="action">
            <xsl:param name="callbackOriginalActionUrl" select="@action"/>
...

        <input type="hidden" name="_TaskDetailsPortlet_WAR_JasperPortal_origina lActionUrl" value="{$callbackOriginalActionUrl}"/>


But it didn't replace it and I got empty value. I also tried variable but that threw some errors. Any ideas, thanks.



 
Old August 27th, 2008, 03:58 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Its hard to say given the fact we don't know what your input XML looks like, or what you want your output to look like.

However you cannot redefine a variable or parameter in XSLT. I suggest just referring to the action attribute in the later input element as
Code:
value="{@action}"
.


/- Sam Judson : Wrox Technical Editor -/
 
Old August 27th, 2008, 04:03 PM
Registered User
 
Join Date: Aug 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, that worked.






Similar Threads
Thread Thread Starter Forum Replies Last Post
selecting param dyn. by variable polarbear XSLT 1 January 19th, 2008 09:03 AM
<input> to Param or Variable bonekrusher XSLT 1 October 11th, 2006 06:00 PM
The difference between xsl:variable and xsl:param NEO1976 XML 2 July 24th, 2006 06:05 AM
Copy File - but need Envirement Variable - VS 2005 oceaniana General .NET 3 April 2nd, 2006 03:49 AM
Need to copy all nodes, attributes, and namespaces juaniux XSLT 4 October 22nd, 2004 04:39 PM





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