[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Client-side XSLT

Subject: Re: Client-side XSLT
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Sun, 25 Sep 2011 09:03:29 -0700
Re:  Client-side XSLT
Thanks again Vasu,

Your information and Martin's response were quite helpful and clear.

However, let me try to make this a purely XSLT issue. Below, I am seeking the means for accomplishing my goal using nothing but XHTML, XML, and XSLT. My question now centers only on passing a parameter to the XSLT stylesheet in this situation:

In following up the leads I got from you and Martin, I discovered that I could generate a new XHTML page using the XSLT snippet below (it creates a web page without reference to JavaScript or PHP). My issue is now with the <a href="{large}> element in the snippet. It opens a file "stamps.xml" which contains the processing instruction: <?xml-stylesheet type="text/xsl" href="render.xsl" ?>

My question: is it possible to open that target XML file with a parameter (such as the number "635") and then pass that parameter on to the XSL processing instruction in some manner that makes it available to "render.xsl"? If I can pass this single parameter through to the XSLT stylesheet, my problem is completely solved. (Since my website is non-commercial, I can insist that it is only available to browsers that can automatically process XSLT).

Or, as both you and Martin seem to imply, must I use a scripting language to achieve my goal of passing a parameter to the XSLT stylesheet?

I am much closer than I was yesterday. Thanks for your patience,
Mark


<xsl:template match="Image">
<xsl:variable name="large">
<xsl:text>stamps.xml</xsl:text>
</xsl:variable>
<xsl:variable name="small" select="concat('../', ancestor::node()/@domain, '/small/', @pofis-number, '.jpg')"/>
<a href="{$large}">
<img src="{$small}" alt="stamp image"/>
</a>
</xsl:template>


-----Original Message----- From: Vasu Chakkera
Sent: Sunday, September 25, 2011 8:31 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Client-side XSLT


Hi Mark,
This is clearly not an XSLT issue, and is more of either a php or a
javascript thing..
but the outline should be...

1. javascript function that takes a param ( which will have the
content of the html for the id) and pops out a page on the onclick
event
2. XSLT should create the a href lines with on click event, calling
the javascript function with the corresponding page contents

this is the over all idea. check the javascript resources for this and
also see if there are alternatives to this in php.

Vasu

On 25 September 2011 06:40, Mark <mark@xxxxxxxxxxxx> wrote:
Martin,
Thank you very much for that information.
Mark
-----Original Message----- From: Martin Honnen
Sent: Sunday, September 25, 2011 3:57 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Client-side XSLT

Mark wrote:

I don't need all the code, I just need to understand - as you suggested
- how to position a Java Query or JavaScript call in place of what is
now the href, then how to execute an XSLT stylesheet in either of those
languages.

Right now, my content XML document contains the names of about 600 jpg
images; it will eventually contain the names of over 3000 jpg images
with associated text. A sample entry would be:

<Stamp>
<CatNumbers number="635"/>
<Value kc-value="3"/>
<Inscriptions czech="Pravda vC-tDzC-" eng="Truth Prevails"/>
</Stamp>

The excerpt I gave in the original email is from one of my indexing html
documents :

<a href="../aip/635.htm"> <img src="../cr/small/635.jpg" alt="stamp
image"/></a>

and was generated from that XML with an XSLT stylesheet, as was the
635.htm page referred to in the href.

Client-side you can run XSLT with browsers like Firefox, Opera, Safari and Chrome using the API described in https://developer.mozilla.org/en/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations With IE the XSLT processor you can use with JScript is MSXML 3 or 6, it has a different API, it is documented in http://msdn.microsoft.com/en-us/library/ms762773%28v=VS.85%29.aspx.


--


Martin Honnen --- MVP Data Platform Development
http://msmvps.com/blogs/martin_honnen/


-- Vasu Chakkera NodeLogic Limited Oxford www.node-logic.com ==============

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.