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 27th, 2007, 12:31 AM
Authorized User
 
Join Date: Mar 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to pass values from one XSLT to another contro

i am extracting some information from xml document. and then i need to pass one value and that is ID to another page (any page .aspx or HTML etc.)....suppose here is my document.

<college>
 <student id="1">
   <name>xxx</name>
   <roll>xxx</roll>
 </student>
<student id="2">
   <name>xxx</name>
   <roll>xxx</roll>
 </student>
 .
 .
 .
 .
 .
 .
 .
</college>

and then i apply some template like this


<xsl:apply-templates select="//student[name='xxx']" />

and suppose there comes 5 records having [u]id</u> from 1 to 5. now i want to pass these ids to another page. how can i do this. i think there is not any array sort of functionality in xslt. any idea will be really appreciated. thanks

I Love XML and family
__________________
I Love XML and family
 
Old March 27th, 2007, 02:28 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I don't really see this as an XML/XSLt question. Sounds like you'd be better processing the XML via the DOM, XmlDocument/XPathDocument in .NET, and selecting the IDs that way. You can then pass them as a delimited string in the URL, myPage.aspx?IDS=1*2*3, for example. Alternatively post data as an XML document:
Code:
<IDS><id>1</id><id>2</id><id>3</id></IDS>
Or look at Server.Transfer for passing control to a new page.

--

Joe (Microsoft MVP - XML)
 
Old March 27th, 2007, 05:43 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

In ASP.NET you can use XSLT. First you need to process your XML file up (use XSLT). Then just pass the ID to quertstring.


Code:
<asp:Xml id="Xml1" runat="server" DocumentSource="~/whatsnew.xml" TransformSource="~/rss.xslt"></asp:Xml>

Code:
                  <a target="_new">
                    <xsl:attribute name="href">
                      editRSS1.aspx?id=<xsl:value-of select="../@id"/>
                    </xsl:attribute>
                    <xsl:apply-templates/>
                  </a>
Your link would look something like this:



Code:
http://yoursite.com/editRSS1.aspx?id=09





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass values between pages msbsam ASP.NET 2.0 Professional 1 July 7th, 2008 06:13 AM
How to pass values between different pages dipanjan22 ASP.NET 1.x and 2.0 Application Design 4 September 30th, 2007 02:02 PM
How to pass values from one iframe to another raaj PHP How-To 0 February 28th, 2007 01:47 AM
Pass Value to XSLT variable bonekrusher XSLT 3 October 9th, 2006 10:16 AM
pass hidden values X-Ken VS.NET 2002/2003 2 September 8th, 2004 07:38 AM





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