On Sep 13, 2004, at 4:32 AM, Eldho George wrote:
Hai all,
Thanks to all of your response.I have problem with <xsl:variable>.I have a
variable 'bordervalue' inside <xsl:stylesheet>.
I am not assign any value to this variable.But inside a template i want to
assign some value to this variable.How can i solve this problem?
I tried with lot.But the variable could not get assigned a new
value.Following is my code snippet...Please help me

As I understand it, you can assign xsl:variable in any template, as long as it is only *once*. The value of a xsl:variable cannot change once it has been set (with some exceptions you can find in the spec and elsewhere on the internet). If you need it to 'change' then you probably want to use xsl:parameter instead.


<?xml version="1.0"?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:fo="http://www.w3.org/1999/XSL/Format";
  xmlns:fox="http://xml.apache.org/fop/extensions";>

<!-- Global variable declaration===-->

<xsl:variable name="bordervalue"/>

        <xsl:template name="inline-style">
                <xsl:if test="$name='border'">
                        <xsl:variable name="bordervalue" select='"$value'"/>

Please note, that the quotes around $value do not nest correctly. I believe you have a single quote, then a double, then $value, then a single and then a double quote.


Perhaps you are going about this the wrong way anyway. Why not create an $inline-bordervalue and then an $other-bordervalue (or whatever) and use them that way.

                </xsl:if>

        </xsl:template>


</xsl:stylesheet/>

Thanks and cheers
george

Hope this helps!

Web Maestro Clay


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to