xsl-list
[Top] [All Lists]

Re: [xsl] extending xsl with javascript

2007-11-08 11:55:01
Hi,

In this example the $pageMode would come from the url, e.g.:

myXML2HTMLpage.xml?mode=List


I don't know of any way to get at command line parameters from xsl. If I could 
access them directly then that is the preferred pathway. 

Please note, although maybe I didn't state my original question clearly, this 
is a specific example of a general problem of using JavaScript to populate a 
XSL variable or parameter. {Or creating XSL functions as wrappers to javascript 
functions). I have seen the web site: http://www.exslt.org/, but unfortunately 
I am having difficulty understanding the information on this site and am 
concerned that I may spend hours/days digesting this information and find out 
that it won't work so some reason. It was my hope that maybe this forum could 
point me in the right direction.

I think maybe I have found what I'm looking for on cafeconleche.org:

http://www.cafeconleche.org/slides/xmloneaustin2001/cuttingedge/116.html

I havn't tried it yet, but hopefully this will open the door to using 
JavaScript to return data to the XSL stylesheet for use while processing the XML

Thanks for your help.

Kind Regards,
April




----- Original Message -----
From: cknell(_at_)onebox(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Sent: Thursday, November 8, 2007 1:15:25 PM (GMT-0500) America/New_York
Subject: RE: Re: [xsl] extending xsl with javascript

How is it that you are accomplishing the transformation that leads you to 
believe that Javascript is the way to set the value of a parameter that you are 
passing to the XSLT?
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     april(_at_)dalyweb(_dot_)com
Sent:     Thu, 8 Nov 2007 13:03:06 -0500 (EST)
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  Re: [xsl] extending xsl with javascript

Hi,

The branching logic refers to accessing different templates within a stylesheet 
depending on the usage scenario. For example:

<xsl:choose>
    <xsl:when test=[$pageMode='List']>
      <xsl:call-template name='ListPage'/>
    </xsl:when>
    <xsl:when test=[$pageMode='Edit']>
      <xsl:call-template name='EditPage'/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name='ErrorPage'/>
    </xsl:otherwise>
</xsl:choose>


I'm sorry if I didn't give a good example of why I want to use JavaScript 
within XSL, but it was the best example I could think of at the moment.

For the example above, how would you populate the pageMode variable ($pageMode) 
via JavaScript?

Thanks in advance for your help and sorry for the confusion.

Regards,
April





----- Original Message -----
From: "Steve" <subsume(_at_)gmail(_dot_)com>
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Sent: Thursday, November 8, 2007 12:46:44 PM (GMT-0500) America/New_York
Subject: Re: [xsl] extending xsl with javascript

Could someone explain 'branching logic'?

-Steve

On Nov 8, 2007 12:45 PM, Colin Adams <colinpauladams(_at_)googlemail(_dot_)com> 
wrote:
That would be sensible if the OP's question were actually about XSLT,
but it looks to me like it is actually a dynamic HTML question (and
therefore off-topic here).


On 08/11/2007, cknell(_at_)onebox(_dot_)com <cknell(_at_)onebox(_dot_)com> 
wrote:
Why not keep things simple and let XSLT do the branching?
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     april(_at_)dalyweb(_dot_)com
Sent:     Thu, 8 Nov 2007 12:11:14 -0500 (EST)
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  [xsl] extending xsl with javascript

Hi,

I am interested using JavaScript with my xsl templates to control branching 
logic but do not have a clue where to start. For example one ability I'd 
like to create is to be able to access command line parameters to a page:

myXML2HTMLpage.xml?mode=List


I have come across a couple of web sites but they all make my head spin (it 
is not pretty!) and I'm not sure if I'm ready to embrace a third party 
library (especially since hugs are no longer allowed in US schools...?)

Can anyone suggest a good, introductory, place to start? hopefully with 
examples...


Thanks in advance for your help!

Kind Regards,
April


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--