[xsl] Adding items to controls generated dynamically thru xsl.

Subject: [xsl] Adding items to controls generated dynamically thru xsl.
From: xslshyam@xxxxxxxxxxxx
Date: 28 Apr 2001 00:21:42 -0700
Hi ALL

I am generating a dynamic asp page based on the DOm and XSL file given below. I am able to generate the page . But I am not able to access any of those controls.
For example There is a Drop down box created when the datatype = "Restricted Dictionary". I have to add some option values to this combo box from the asp page.These option values I am getting by invoking a component in the asp page. But I am not able to add any values to this list box.


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&apos;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> 

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


Current Thread