This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to modify xsl:param with javascript


Hi,
I decided to put my javascript function into a file
called increment.js like this:

fuction increment()
{
  var s =
document.XSLDocument.selectSingleNode("/*/xsl:template[@match='/']//xsl:apply-templates/xsl:with-param[@name='startIndex']/@select");
  s.value = s.value + 10;
}

then I include it like:

<script src="/pxc/increment.js"
language="JavaScript"></script>

and from <a> tag, I call the function in order to
increment the xsl parameter startIndex, like this:

<a href="JavaScript:increment()">

It still does not work. Do I need to pass some
parametes into the function? or return something from
there? I am new to JavaScript and any kind of help is
greatly appreciated.
Regards,
Davut

--- Robert Koberg <rob@koberg.com> wrote:
> in your onclick you have double quotes nested inside
> of double quotes. that
> is a no-no.
> 
> a better way to handle this is to create a JS
> function (put in the head with
> cdata or included) and send the variable info as
> parameters to the function
> 
> 
> ----- Original Message -----
> From: "davut karabay" <dkarabay@yahoo.com>
> To: <XSL-List@lists.mulberrytech.com>
> Sent: Friday, March 09, 2001 5:06 PM
> Subject: [xsl] How to modify xsl:param with
> javascript
> 
> 
> > Hi,
> > My xml data would probably contain hundreds of
> device
> > names in it. I would like to make my xslt sheet to
> > process the data 10 at a time. In other words,
> only
> > first 10 of the xml data will be displayed in the
> > first html page. There will be a "More" hyperlink
> at
> > the bottom of the page and once clicked, next 10
> > should be listed so and so forth...
> >
> > I define a parameter called startIndex with an
> initial
> > value of 0. Then I would like to increase it by 10
> > every time the user clicks "More" hyperlink. When
> I
> > display devices, I choose ones whose position()
> > greater than startIndex and less than
> (startIndex+10).
> >
> > Here is the related part of my xslt sheet which
> would
> > not be processed for some reason that I don't
> > understand.
> >
> > <xsl:param name="startIndex" select="0"/>
> > .....
> > .....
> >
> > <xsl:apply-templates select="device[position()
> > &gt;=$startIndex and position()
> > &lt;=($startIndex+10)]"/>
> > .....
> > .....
> >
> > <a href="javascript:void(0);"
> > onMouseOver="self.status='More'; return(true);"
> > onClick="var
> >
>
s=style.selectSingleNode("/xsl:stylesheet/xsl:param[@name='startIndex']");
> > s.value=s.value+10; return(false);"
> > onMouseOut="self.status=''">More</a>
> > .....
> > .....
> >
> > I can not even see the first page. Here is the
> message
> > I got:
> >
> > Element type "a" must be followed by either
> attribute
> > specifications, ">" or "/>".
> >
> > I understand it does not like it within <a> tag
> but I
> > don't know why.
> > Does anyone have any suggestions on How else I
> could
> > write it?
> >
> > Regards,
> > Davut Karabay
> >
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> >
> >  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> >
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]