xsl-list
[Top] [All Lists]

Re: how to get variable value outside scope

2005-02-26 16:54:46

Why are you using d-o-e everywhere?

By doing this

                                <xsl:text
disable-output-escaping="yes">&lt;/td&gt;</xsl:text>

rather than generating a td element node you are losing much of the
benefit of using xslt. Here you are generating the markup tagging of an
XML document string directly and XSLT is explictly designed not to give
direct acces to the tags either on input or output, so although d-o-e
gives some kind of half hearted support for this (on xslt systsems that
support d-o-e) you're almost always better using perl or some other such
text based system if you need to generate tags.

On the other hand it looks like it would be easy enough to generate the
nodes directly, for example:

                        <tr>
                                <xsl:text
disable-output-escaping="yes">&lt;td width="100%"
valign="top"&gt;</xsl:text>
                        No events are currently scheduled.
                 <xsl:text
disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
                        </tr>


could more easily and more portably be coded as


                        <tr>
                    <td width="100%" valign="top">
                        No events are currently scheduled.
                    </td>
                        </tr>

What I am trying to do is capture the value of the
"category" variable and pass it outside the current scope so I can link
to another page with more content relevant to the specific category. 

I didn't follow the details of your coding but this is what
xsl:with-param is for (most likely). If one template depends on a value
calculated by another then you need tp pass that value as a parameter.


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--