Sunday, April 25, 2010

additional info xslt

<?xml version="1.0" encoding="UTF-8"? >
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:asp="remove" >
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:param name="requestoremail"/>
<xsl:param name="requestorlocation"/>
<xsl:param name="requestorpassword"/>
<xsl:param name="array"/>
<xsl:param name="strBreak"/>

<xsl:param name="strCurrentDate"/>

<xsl:template match="ITRAC/ServiceName">
<table border="0" cellpadding="0" cellspacing="0" width="710px" >
<tr>
<td>
<div id="content_area_Popup">
<div class="ControlHeading">
<table border="0" cellpadding="0" cellspacing="0" width="710px">
<tr>
<td>
<div id="ModalPopuprequest_heading">
<xsl:value-of select="@name"/>
</div>
</td>
</tr>
<tr>
<td>
<div id="ModalPopuprequest_Directive">
Please provide the detail request information below:
</div>
</td>
</tr>
<tr>
<td>
<div id="ServicePopupInner" >
<table border="0" cellpadding="0" cellspacing="0" class="service_contentTable" >
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td height="5px">
</td>
</tr>
<xsl:for-each select="//Field">
<tr>
<xsl:if test="@id!='footername'">
<xsl:if test="@type = 'LabelHeadcol1'">
<td colspan="3">
<asp:Label runat="server" text="{@headtext1}" CssClass="labelHeading" />
</td>
</xsl:if>
<xsl:if test="@type = 'LabelHeadcol1'">
<td colspan="3">
<asp:Label runat="server" text="{@headtext2}" CssClass="labelHeading" />
</td>
</xsl:if>
<xsl:if test="@type = 'LabelHeadcol2'">
<td style="width:10px"></td>
<td colspan="3">
<asp:Label runat="server" text="{@headtext1}" CssClass="labelHeading" />
</td>
</xsl:if>
</xsl:if>
</tr>
<tr>
<xsl:if test="@id!='footername'">
<td style ="width:10px; padding:3px 3px 3px 3px;" >

<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='false' and @checkboxType='Checkbox'">
<asp:CheckBox id="{@checkboxid}" runat="server" />
</xsl:if>
</td>
<td>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='false' and @checkboxType='Checkboxindent1'">
<asp:CheckBox id="{@checkboxid}" runat="server" />
</xsl:if>
</td>
<td class="labelText" valign="middle" style ="padding-left:5px">
<xsl:variable name="strNew"></xsl:variable>
<xsl:choose>
<xsl:when test="contains(@label, '\n')">
<xsl:value-of select="substring-before(@label, '\n')"/>
<br/>
<p class="SubTextInPopUp"><xsl:value-of select="substring-after(@label, '\n')"/></p>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@label"/>
</xsl:otherwise>
</xsl:choose>
<asp:Label runat="server" text="{$strNew}"/>
</td>
<td style="width:5px">
</td>
<td valign="top" style ="padding:3px 3px 3px 3px;" >
<xsl:if test="@type = 'Label' and @SecondColumn='true'">
<asp:Label id ="{@id}" runat="server" text="{@label}" Font-Bold="true" />
</xsl:if>
<xsl:if test="@type = 'TextArea'">
<asp:TextBox id="{@id}" runat="server" text="" CssClass="inputboxpopup" height="100px" TextMode="MultiLine" />
</xsl:if>
<xsl:if test="@type = 'Date'">
<asp:TextBox id="{@id}" runat="server" CssClass="date-pick" />
</xsl:if>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='false'">
<asp:TextBox id="{@id}" runat="server" text="" CssClass="inputboxpopup"/>
</xsl:if>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='true' and @id='requestoremail'">
<asp:TextBox id="{@id}" runat="server" text="{$requestoremail}" CssClass="inputboxpopup"/>
</xsl:if>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='true' and @id='requestorlocation'">
<asp:TextBox id="{@id}" runat="server" text="{$requestorlocation}" CssClass="inputboxpopup"/>
</xsl:if>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='true' and @id='requestorregion'">
<asp:TextBox id="{@id}" runat="server" text=" " CssClass="inputboxpopup"/>
</xsl:if>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='true' and @id='requestoroffice'">
<asp:TextBox id="{@id}" runat="server" text=" " CssClass="inputboxpopup"/>
</xsl:if>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='true' and @id='requestordivision'">
<asp:TextBox id="{@id}" runat="server" text=" " CssClass="inputboxpopup"/>
</xsl:if>
<xsl:if test="@type = 'TextBox' and @IsActiveDirectory='true' and @id='requestorpassword'">
<asp:TextBox id="{@id}" runat="server" text="{$requestorpassword}" CssClass="inputboxpopup" readonly="false" />
</xsl:if>
<xsl:if test="@type = 'TextBoxText' and @IsActiveDirectory='true'">
<asp:TextBox id="{@id}" runat="server" Text="{@text}" CssClass="inputboxpopup" />
</xsl:if>
<xsl:if test="@type = 'CheckBoxList'">
<asp:CheckBoxList id="{@id}" runat="server" RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="{@RepeatColumns}">
<xsl:for-each select="Listitems/Listitem">
<asp:ListItem value="{@value}" text="{@text}" Selected="{@selected}" CellSpacing="10px" style="padding:0 35px 8px 1px; vertical-align:top; margin: 0; float:left;"></asp:ListItem>
</xsl:for-each>
</asp:CheckBoxList>
</xsl:if>
<xsl:if test="@type = 'DropDownList' and @IsActiveDirectory='false'">
<asp:DropDownList id="{@id}" runat="server" style="width:209px;">
<xsl:for-each select="Listitems/Listitem">
<asp:ListItem value="{@value}" text="{@text}" Selected="{@selected}" ></asp:ListItem>
</xsl:for-each>
</asp:DropDownList>
</xsl:if>
<xsl:if test="@type = 'ListBox'">
<asp:ListBox id="{@id}" runat="server" SelectionMode="Multiple" style="width:209px;">
<xsl:for-each select="Listitems/Listitem">
<asp:ListItem value="{@value}" text="{@text}" Selected="{@selected}" ></asp:ListItem>
</xsl:for-each>
</asp:ListBox>
</xsl:if>

<xsl:if test="@type = 'RadioButtonList'">
<asp:RadioButtonList id="{@id}" runat="server" RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="{@RepeatColumns}">
<xsl:for-each select="Listitems/Listitem">
<asp:ListItem value="{@value}" text="{@text}" Selected="{@selected}" style="padding:0 35px 8px 1px; vertical-align:top; margin: 0; float:left;" ></asp:ListItem>
</xsl:for-each>
</asp:RadioButtonList>
</xsl:if>

<div style="padding-left:20px;">
<xsl:if test="@type = 'RadioButtonListIndent2'">
<asp:RadioButtonList id="{@id}" runat="server" RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="{@RepeatColumns}">
<xsl:for-each select="Listitems/Listitem">
<asp:ListItem value="{@value}" text="{@text}" Selected="{@selected}" style="padding:0 35px 8px 1px; vertical-align:top; margin: 0; float:left;" ></asp:ListItem>
</xsl:for-each>
</asp:RadioButtonList>
</xsl:if>
</div>
</td>
</xsl:if>
<xsl:if test="@type = 'label' and @id='footername'">
<td class="labelHeading" colspan="6" align="left" style="padding-left:60px;">
<asp:Label runat="server" text="{@label}"/>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</xsl:template>
<xsl:template name="break">
<xsl:param name="text" select="."/>
<xsl:choose>
<xsl:when test="contains($text, ' ')">
<xsl:value-of select="substring-before($text, ' ')"/>
<br/>
<xsl:call-template name="break">
<xsl:with-param name="label" select="substring-after($text, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

No comments: