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 July 14th, 2007, 11:23 PM
Registered User
Join Date: Jul 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to pauljr8
Default Client Side Processing

I am using php to call an xsl stylesheet which parses the entire xml file. All the templates I use are already parsed. I want to change what is displayed in a certain <div> based on the user clicking on links. The links contain the parameters for rendering the correct portion of the xml. I have been using asp and am converting all my sites to php. I can achieve the effect with either passing the parameter to the stylesheet. But, I want to know if the same thing is possible without any more server-side scripting, since the xml and xsl have already been sent to the client. It seems that the parameter could be modified at the client by a click that triggers "maybe" xsl:call-template and xsl:with-parameter to display the appropriate content.

Paul Hickey
Old July 15th, 2007, 12:06 PM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

Sorry, I haven't understood something. You seem to be describing an ASP or PHP application in which an XSLT transformation is invoked on the server. Then you say the "xml and xsl have already been sent to the client". Which is it?

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Old July 15th, 2007, 12:45 PM
Registered User
Join Date: Jul 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to pauljr8

Sorry about that. The xsl and xml are processed at the server using php. Now that the result has been sent to the client, is it necessary to reprocess the xml at the server just to change the contents of a <div>. I am looking at having navigation links say on the left of a web page which when clicked on change the contents of a <div> elsewhere on the page without reprocessing the tree at the server and preferably without any client side scripting. This is being done now via an xsl:parameter, e.g. and php and another round trip to the server for the same information.

<menu name="Home">
<mission>We do lots of computer stuff.
<menu name="Contact Us">

<name>My Computer Services Inc.#169;</name>
<address1>123 W. Flower Blvd.</address1>

<div class="lsidebar" align="left">
<ul align="left"><xsl:for-each select="site/menus/menu">
<li align="left"><strong><a><xsl:attribute name="href">selectmenu.php?name=<xsl:value-of select="@name" />
</xsl:attribute><xsl:value-of select="@name" /></a></strong><br /><br /></li></xsl:for-each>

<div class="main"><div class="hr"></div><xsl:apply-templates select="site/menus/menu[@name=$name]" /></div>

<xsl:template match="mission">
<div class="main">
<p><xsl:apply-templates /></p>

<xsl:template match="company">
<div class="main">
<table width="50%" align="center">
<tr><td align="left"><strong><xsl:apply-templates select="name" /></strong><br /></td></tr>
<tr><td align="left"><strong><xsl:apply-templates select="address1" /></strong><br /></td></tr></table></div>

So instead so instead of a href=selectmenu.php?name=@name

is it in any way possible (without script)for it to call a different template match since I believe the information is already there. <xsl: template match="Home"> is the default displayed in <div class="main">.
I am hoping/wishing that the link could just call <xsl: template match="company"> when clicked.

Paul Hickey

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Converting Client-side to Server-side Code kwilliams ASP.NET 2.0 Professional 1 November 21st, 2007 05:25 PM
Firing server side events at client side codes mehdi62b ASP.NET 1.0 and 1.1 Basics 6 May 18th, 2005 09:11 AM
sharing a server-side variable with client-side pigtail Javascript How-To 6 November 4th, 2004 02:01 AM
Two Client Side vs Server Side issues Milo Classic ASP Professional 5 May 25th, 2004 02:47 PM
Accessing Server Side Data on Client Side steve456 Classic ASP Professional 3 October 15th, 2003 02:33 PM

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