Menu

"Array" in variable

Help
2003-09-03
2003-11-06
  • Alex Prilop

    Alex Prilop - 2003-09-03

    Hi,

    I am trying to read in an array as a variable and then work over it in a for-each loop.
    In xsl the following works for me, but seem not to work in ejen:

    <xsl:variable name="beans" select="/desc/bean" />
    <xsl:for-each select="$beans" >
    </xsl:for-each>

    if I do the analog in <ejen>  with <variable> and <foreach> I get an EjenAttributeException.
    <variable name="beans" select="/desc/bean" />
    <foreach select="$beans">
         <echo message="The current ejb is {$beans/@name}" />
    </foreach>

    What do I do wrong?
    Thanks for your help
    Alex Prilop

     
    • Franck Wolff

      Franck Wolff - 2003-11-06

      Hi,

      1. You should use:

      <echo message="The current ejb is {@name}" />

      "$beans/@name" will always give you the same result (ie: the name of the FIRST bean in the node set).

      2. I cannot reproduce the exception when I'm using "$beans/@name"... Any details?

      Regards,
      Franck.

       

Log in to post a comment.