RE: [xsl] variable declaration

Subject: RE: [xsl] variable declaration
From: "KUMAR NINGASHETTY" <kningashetty@xxxxxxxxxxxxxxxx>
Date: Mon, 29 Apr 2002 11:17:41 -0400
I do accept that using <xsl:attribute ... may be an efficent way ...
But what do you mean by "Speaking of case, what if the value was the result of an
<xsl:choose/> structure?   "


<input type="text" value="{@name}"/>  - Expression of this kind with the value as a result of  <xsl:choose/> 
should perfectly work fine too...I have been using this way ...I agree it may be little lengthier code ...
Or Did you mean something else ??

-kumar



>>> michael@xxxxxxxxxx 04/29/02 10:29AM >>>
You are absolutely correct.  However, one must be careful when using
shortcuts.

Here are the justifications for the "long" way:

1) What is the default namespace?  If it is HTML, then the shortcut is
fine, because it assumes HTML.  However, assumptions are dangerous foes
when working with well-formed, mature software systems.  The example
that I provided ensures that the XSLT itself can be loaded and validated
within a DOM instance regardless of the output format.

2) The use of the <xsl:attribute/> element allows us to contain more
than a simple literal.  What if the value of the text field was the
result of an applied template?  The shortcut would not work in this
case.  Speaking of case, what if the value was the result of an
<xsl:choose/> structure?  Same problem.

Just something to consider when learning this technology.

Good luck.

Michael Earls



-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Oleg
Tkachenko
Sent: Monday, April 29, 2002 10:55 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
Subject: Re: [xsl] variable declaration


Michael Earls wrote:
> 
> "And please can anyone help me out on
> values for text boxes in XSL's
> for an <input type="text" value=????>
> how do i specify the value ??"
> 
> <xsl:element name="input">
> 	<xsl:attribute name="type">text</xsl:attribute>
> 	<xsl:attribute name="value">??</xsl:attribute> </xsl:element>

Or even shorter one:
<input type="text" value="{Your_XPath_Expression}"/>

-- 
Oleg Tkachenko
Multiconn International, Israel


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread