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 January 4th, 2007, 12:45 PM
Registered User
 
Join Date: Dec 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Of course. It was stupid of me to have overlooked this :| Thanks to everyone for your help :)
 
Old January 4th, 2007, 03:18 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Doh!!!

--

Joe (Microsoft MVP - XML)
 
Old January 4th, 2007, 03:27 PM
Registered User
 
Join Date: Dec 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

indeed. Homer Simpson would be proud :)
 
Old January 4th, 2007, 03:54 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

My role model...

--

Joe (Microsoft MVP - XML)
 
Old January 9th, 2007, 11:58 AM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I am having the same problem even with <

Can you please advice what i am doing wrong?

Here ie my code,

if(document.all.node1.value != "")
{
var arrVal = (document.all.node1.value).split(";");
var i = 0;
var x = (arrVal.length)-1;
    alert(x);

for(i = 0; i < x; i++)
{
    alert(' i is ' + i);


}

it's keep incrementing the value of i.
 
Old January 9th, 2007, 04:19 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I'm no expert on Javascript and I can't see why you are asking Javascript questions on an XSLT forum, but if I wanted to write code that kept incrementing the value of i, this is exactly what I would write.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 11th, 2007, 07:51 AM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi mhkay,

Reason i am asking on this forum is i am writing this js function with xsl file and i wont able to use < sign and am using &lt; instead. It should finish looping when i < x, i.e x=5 but it's keep going.

Anyone any idea?

Regards
Selvan
 
Old January 11th, 2007, 08:29 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

What does x get alerted as? Can you show the view-source of the JavaScript exactly as it appears in the rendered HTML?

--

Joe (Microsoft MVP - XML)
 
Old February 1st, 2007, 07:30 PM
Authorized User
 
Join Date: Nov 2003
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to seanmayhew
Default

Im not sure why the fit about trying to get javascript into xslt other than Im trying to test locally for a larger problem and my for loop is not cooperating either.....

Code:
               

function init(){
 var panels = document.getElementById("divIds").getElementsByTagName("div");
/*THIS WILL OUTPUT A NUMBER example: '21' */
document.write(panels.length);
/* COMMENT OUT THE document.write and this for loop produces an error*/
for(var i = 0; i < panels.length; i++)
{} 
}
The error produced is
"Error: Expected ')'"

The same error is produced using "&lt;"

Im curious if this is the result of the the script believing the line is terminated with the second ";" as using "&lt;" brings the count of ";"'s to three instead of two. Maybe?

 
Old February 1st, 2007, 07:31 PM
Authorized User
 
Join Date: Nov 2003
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to seanmayhew
Default

also, the reason for these questions in an XSLT forum is that XSLT is the only place the for loop seems to be a problem....even with CDATA






Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested For-Each Loop In XSLT dghosh XSLT 10 July 2nd, 2008 04:34 AM
XSLT Loop? kwilliams XSLT 1 June 16th, 2008 06:04 PM
xslt when loop problem check XSLT 1 April 18th, 2008 08:47 AM
FOR LOOP IN XSLT im_himanshu2004 XSLT 0 October 10th, 2007 02:27 PM
loop in xslt vazarshahy XSLT 6 June 7th, 2006 04:46 PM





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