You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by J�rn Tage Tyskerud <ty...@yahoo.com> on 2001/03/02 16:18:52 UTC

Problems with java iterators

Hi all.

I'd like to start this email by saying that Xalan is a
great product, and that you guys have done a great
job.

However, I'm experiencing some troubles when using a
java.util.Iterator object in my xsl stylesheet.

The error is a TransformerException:
<output-snip>

        iterator: TransformerException
java/util/LinkedList$ListItr
XsltTransform done.
</output-snip>

I'm running Win2K with jdk1.2.2 and a xalan 2.0.0
bundle from 02/02/01.


Here is my stylesheet:

<!-- stylesheet-snip -->

<xsl:template name="write-prodatr-element">
  <!-- java.util.LinkedList object passed as an arg
-->
  <xsl:param name="list" />

  <!-- Gets the Iterator object -->	
  <xsl:variable
    name="iterator"
    select="java:iterator($list)"
  />

  <!-- This call produce the TransformerException -->
 iterator: <xsl:value-of
select="java:hasNext($iterator)" />

</xsl:template>

<!-- stylesheet-snip ends -->

I know the list contains two elements, so the
hasNext() call is returning true. 

So, what do I do wrong? Any help, hints, or pointers
will be highly appreciated.

Thanks,
-jt

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/