You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by heed heed <he...@yahoo.com> on 2001/02/14 01:14:58 UTC

Scope question

Could someone please tell me how Xalan scopes the
variables "tag_name" and "tag_value" as shown below:

      <xsl:for-each select="./coverageType">
            <xsl:variable
name="tag_name"><xsl:value-of
select="name()"/></xsl:variable>
            <xsl:variable
name="tag_value"><xsl:value-of
select="."/></xsl:variable>
            <xsl:choose>
               <xsl:when test="@writeable!='true'">
                  <input type="text"
name="{$tag_name}:{$counter}" value="{$tag_value}"
size="18" maxlength="30"/>
               </xsl:when>
               <xsl:otherwise>
		  <xsl:value-of select="."/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:for-each>

Should I not be able to access these variables from
within the choose tag?


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Re: Scope question

Posted by Gary L Peskin <ga...@firstech.com>.
heed heed wrote:
> 
> Gary - Thank you for responding to my question.
> 
> We fixed the problem by changing our XSL, which was
> being transformed via Bluestone (com.bluestone.xml)
> package (I believe they were/are using an old version
> of the Lotus processor? I could be wrong.)
> 

Good luck with your migration.  Please be sure to let us know of any
other suspected Xalan problems so we can check them out.

Gary

Re: Scope question

Posted by heed heed <he...@yahoo.com>.
Gary - Thank you for responding to my question.

We fixed the problem by changing our XSL, which was
being transformed via Bluestone (com.bluestone.xml)
package (I believe they were/are using an old version
of the Lotus processor? I could be wrong.) 

We are moving an e-com app from Bluestone to Tomcat
3.2.1 and Xalan/Xerces and have had relatively few
problems that weren't caused by weird Bluestone
behavior.  We're trying very hard to refactor our XSLs
to spec during this port, and we've found a couple of
instances where Xalan handles our XML a bit
differently.

For example, in the code snippet that I sent to the
list, the 'writable' tag was being held onto by a
Bluestone object and referenced by the Bluestone
processor (somehow).  Xalan had no idea what the
'writable' tag was, or where it came from because we
have cleansed Bluetone-spectific code from our
application.

Thanks again for your help.

Heed
--- Gary L Peskin <ga...@firstech.com> wrote:
> heed heed wrote:
> > 
> > Could someone please tell me how Xalan scopes the
> > variables "tag_name" and "tag_value" as shown
> below:
> > 
> >       <xsl:for-each select="./coverageType">
> >             <xsl:variable
> > name="tag_name"><xsl:value-of
> > select="name()"/></xsl:variable>
> >             <xsl:variable
> > name="tag_value"><xsl:value-of
> > select="."/></xsl:variable>
> >             <xsl:choose>
> >                <xsl:when
> test="@writeable!='true'">
> >                   <input type="text"
> > name="{$tag_name}:{$counter}" value="{$tag_value}"
> > size="18" maxlength="30"/>
> >                </xsl:when>
> >                <xsl:otherwise>
> >                   <xsl:value-of select="."/>
> >                </xsl:otherwise>
> >             </xsl:choose>
> >          </xsl:for-each>
> > 
> > Should I not be able to access these variables
> from
> > within the choose tag?
> 
> Yes.  You should.  If you're having a problem,
> please send along your
> XML and complete XSLT and we'll see if we can
> reproduce it.
> 
> Gary


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Re: Scope question

Posted by Gary L Peskin <ga...@firstech.com>.
heed heed wrote:
> 
> Could someone please tell me how Xalan scopes the
> variables "tag_name" and "tag_value" as shown below:
> 
>       <xsl:for-each select="./coverageType">
>             <xsl:variable
> name="tag_name"><xsl:value-of
> select="name()"/></xsl:variable>
>             <xsl:variable
> name="tag_value"><xsl:value-of
> select="."/></xsl:variable>
>             <xsl:choose>
>                <xsl:when test="@writeable!='true'">
>                   <input type="text"
> name="{$tag_name}:{$counter}" value="{$tag_value}"
> size="18" maxlength="30"/>
>                </xsl:when>
>                <xsl:otherwise>
>                   <xsl:value-of select="."/>
>                </xsl:otherwise>
>             </xsl:choose>
>          </xsl:for-each>
> 
> Should I not be able to access these variables from
> within the choose tag?

Yes.  You should.  If you're having a problem, please send along your
XML and complete XSLT and we'll see if we can reproduce it.

Gary