This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: dropdown box - style !! urgent
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] dropdown box - style !! urgent
- From: Meltem Kogelbauer <meltem dot kogelbauer at netdecisions dot co dot uk>
- Date: Thu, 3 May 2001 17:53:27 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
I think I understand your problem.
try this for your combo box:
<select>
<xsl:attribute name="style">
width:<xsl:value-of select="@MaximumLength" />
</xsl:attribute>
......
</select>
Meltem
-----Original Message-----
From: xslshyam@123india.com [mailto:xslshyam@123india.com]
Sent: 28 April 2001 7:52 AM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] dropdown box - style !! urgent
Hi ALL
I am shyam , working in an Indian based firm called Ramsoft
Technologies. I am facing a problem with XSL in my current project.
I have an xsl file which generates the html controls based on an XML DOM.
the problem occurs in the case of Drop down list box. I am not able to set
the width of
the combo box. How can I set the width?
My XML DOM is something like this:
<DataItems>
<DataItem Label = 'Result Priority:' Value = 'Routine' DataType =
'Restricted Dictionary' Mandatory = 'False' MaximumLength = '30'
NumberOfLines = '1'/>
<DataItem Label = 'Special Instructions:' Value = '' DataType = 'Free
Format Text' Mandatory = 'True' MaximumLength = '255' NumberOfLines = '3'/>
<DataItem Label = 'Priority' Value = '' DataType = 'Restricted Dictionary'
Mandatory = 'False' MaximumLength = '30' NumberOfLines = '1'/>
<DataItem Label = 'Rob's Check' Value = '' DataType = 'Checkbox'
Mandatory = 'False' MaximumLength = '1' NumberOfLines = '0'/>
</DataItems>
And the xsl file I am using is
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<!-- the match on the root node starts the HTML document-->
<xsl:template match="/">
<table>
<xsl:for-each select="//DataItems/DataItem">
<tr>
<td id="lblLabelCol" nowrap="true">
<p align="right">
<label>
<xsl:if match=".[@Mandatory='True']">
<img id="imgMandatory"
src="../Images/BlueStar.jpg"></img>
</xsl:if>
<xsl:value-of select="@Label"/>
</label>
</p>
</td>
<xsl:if match=".[@DataType='Checkbox']">
<td id="lblControlCol">
<input class="OrderInfoCheckbox" type="checkbox"
readonly="true" disabled="true">
<xsl:attribute name="value">
<xsl:value-of select="@Value"/>
</xsl:attribute>
</input>
</td>
</xsl:if>
<xsl:if match=".[@DataType='Free Format Text']">
<td id="lblControlCol">
<xsl:if match=".[@NumberOfLines>'1']">
<textarea class="OrderInfoTextarea" readonly="true">
<xsl:attribute name="value">
<xsl:value-of select="@Value"/>
</xsl:attribute>
<xsl:attribute name="cols">
<xsl:value-of select="@MaximumLength"/>
</xsl:attribute>
<xsl:attribute name="rows">
<xsl:value-of select="@NumberOfLines"/>
</xsl:attribute>
</textarea>
</xsl:if>
<xsl:if match=".[@NumberOfLines='1']">
<input class="OrderInfoLargeText" type="text"
readonly="true">
<xsl:attribute name="value">
<xsl:value-of select="@Value"/>
</xsl:attribute>
<xsl:attribute name="size">
<xsl:value-of select="@MaximumLength"/>
</xsl:attribute>
</input>
</xsl:if>
</td>
</xsl:if>
<xsl:if match=".[@DataType='Restricted Dictionary']">
<td id="lblControlCol">
<select id="lstDictionary" name="lstDictionary"
class="OrderInfoList" readonly="true" disabled="true">
<option><xsl:value-of select="@Value"/></option>
</select>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Here for setting the width for the combo box normally I should give
"style=width:<MaximumLength>". But how will I make an xsl attribute
"style=width:"
and how will I assign this length to the above attribute ??
I have one more doubth : This Maximum Length I am getting in characters. But
I think the width attribute takes only in Pixels. % etc . How will i convert
this
characters in terms of pixels??
This project is meant to work only with IE 5.5 and I am using MSXML3.0 .
I will be grateful to you for your response and it is quite urgent.
Thanks and Regards
Shyam
______________________________________________________
123India.com - India's Premier Portal
Get your Free Email Account at http://www.123india.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list