XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Daniel LucioSubject: invalid reentering FOR loops
Author: Daniel Lucio
Date: 21 Aug 2002 11:59 AM
Hi!

I noticed that the XSLT code:




loops twice even it should iterate once! So, that the second time, the extension "add" is called with empty arguments, which throws exceptions!
And would really appreciate any input on this.

Regards

Postnext
Minollo I.Subject: Re: invalid reentering FOR loops
Author: Minollo I.
Date: 21 Aug 2002 12:32 PM
Daniel,
it is virtually impossible for us to understand where the problem is
here unless you send us the source XML document you are using.

It sounds pretty strange that there is a problem like that (I've tried
reproducing it with no luck), but we really need some more context.

Thanks,
Minollo

Postnext
Daniel LucioSubject: invalid reentering FOR loops
Author: Daniel Lucio
Date: 21 Aug 2002 12:37 PM
Mmmm ok I will send to you my xml file which I am trying to process.

Regards


DocumentMAPK.xml
Source xml file

Postnext
Daniel LucioSubject: invalid reentering FOR loops
Author: Daniel Lucio
Date: 21 Aug 2002 12:40 PM
Also, I forgot to mention that this happens using ths Stylus studio with Xalan (2.4_D1).

Regards

Postnext
Minollo I.Subject: Re: invalid reentering FOR loops
Author: Minollo I.
Date: 21 Aug 2002 01:18 PM
Looking at your XML document, you have multiple and
elements. Now, if I try running anything like what you posted:

{xsl:for-each select="cellml:component/cellml:variable"}
{xsl:variable name="addingDummy"
select="nameManager:add($nameManager,../@name,@name)"/}
{/xsl:for-each}

....I get several loops, as expected.

Can you give me more details about where you are using that piece of code,
what's the context and why you would assume it loops only once?

Thanks,
Minollo

Postnext
Daniel LucioSubject: Re: invalid reentering FOR loops
Author: Daniel Lucio
Date: 21 Aug 2002 02:06 PM
Carlo,

Ok, the objective of this piece of code (lines 59-61 of the attached script) is used to retrieve all the cellml:variable elements contained on every cellml:component element.
The case where Stylus Studio stops because it gest an IllegalArgumentException is when processing the first cellml:component of my document with name "global_variables" which only contains one cellml:variable element with name "time". So the FOR loop first reads this cellml:variable correctly, and pases its information to the java extension, but then, it iterates a second time when it shouldn't! And then calls my java extension with empty arguments, which then throws the exception! If run the script from the command line or my program it works, but not inside Stylus!! =( I hope this might clarify the problem.

Regards


Documentc2b.xslt
xslt script

Posttop
Minollo I.Subject: Re: invalid reentering FOR loops
Author: Minollo I.
Date: 21 Aug 2002 05:44 PM
I think I understand part of the problem.

The for-each loop is running properly; but it IS confusing, because in BL96
XalanJ step-by-step debugging gets confused about comments; so when the
cursor moves to an XSLT line containing a comment, it jumps back to the
previous line and then after the comment line. That may give you the
impression that the for-each is executed more times than it actually is.

But I have tried outputting the value-of ../@name and @name in the for-each
block, and I get what I would expect:
global_variables, time
R, R
R, delta_R_ligand_receptor_binding
...

So, I think the problem is elsewhere. Not having the Java extensions you
are using, I can't reproduce the error you are seeing; in order to
investigate further, I will need the Java extensions code.

BTW, the bad behavior doing step-by-step over comments has been addressed,
and a fix will be available soon.

Thanks,
Minollo

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.