Link to home
Start Free TrialLog in
Avatar of gsfc
gsfcFlag for United States of America

asked on

xsl:if statement needs to call wav file

I have a Sharepoint 2003 page that displays some database information. One of the fields is a numerical value of 0, 1, 2, 3 etc...etc...
The user wants a sound file to be played when the value changes from 0 to anything else. This is a calls on hold field, so when a customer calls in and gets put on hold the field reflects the number of calls that are currently on hold. most of the time it is 0.
I have it currently setup to change colors of the field when the number is > 0 however, I  cannot figure out how to call a wav file which is located on the web server.
I have attached the code I am currently using. This codes works perfectly for changing colors, I just cannot seem to call the sound file.
I have the URL to the sound file on the web server, if I go directly to that URL it plays the file.  Also if I create a button that calls the wav file it will play, the xsl:if statement is where I have the issue.

Thanks for your help. Chris.
<span>
							<xsl:attribute name="style">
								<xsl:if test="number(@callsonhold) = '0'">background-color: #00FF00;</xsl:if>
								<xsl:if test="number(@callsonhold) &gt; '0'">background-color: #FF0000; border: thick solid #0000FF; text-decoration: blink;</xsl:if>
							</xsl:attribute>
							<xsl:value-of select="@callsonhold" />
							</span></td>
					</tr>
				</xsl:if>
			</xsl:if>

Open in new window

Avatar of gsfc
gsfc
Flag of United States of America image

ASKER

Anyone read this or have any ideas?
I don't know if you can play a wav file without initiating from an onLoad event. When do the events occur? If you are reloading a page, then it is possible. Otherwise, I don't think it can be done.
Avatar of gsfc

ASKER

The page has an auto refresh every 30 seconds, thats when the sound would play.
Can you post some of your XML?
Without knowing anything about your XML, I put together something to show how you can do it. The javascript that plays the sound will only work in IE, but can be changed easily. The XSLT is based on the following XML snippet:

<?xml version="1.0"?>
<root>
      <calls>
            <call callsonhold="0">
            </call>
      </calls>
</root>

HTH
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" indent="yes"/>
	<xsl:param name="holding" select="//@callsonhold"/>
	<xsl:template match="/">
		<html>
			<head>
				<title>Play sound when callsonhold > 1</title>
				<script>
function playSound(url) {
  document.all.sound.src = url;
}
</script>
			</head>
			<body>
				<xsl:if test="$holding &gt; '0'">
					<xsl:attribute name="onLoad">
						<xsl:text>playSound('blip.wav');</xsl:text>
					</xsl:attribute>
					<bgsound id="sound"/>
				</xsl:if>
				<p><xsl:apply-templates/></p>
			</body>
		</html>
	</xsl:template>
 
	<xsl:template match="calls">
		<xsl:apply-templates/>
	</xsl:template>
 
	<xsl:template match="call">
		<span>
			<xsl:choose>
				<xsl:when test="//@callsonhold &gt; '0'">
					<xsl:attribute name="style">
						<xsl:text>background-color: #FF0000; border: thick solid #0000FF; text-decoration: blink;</xsl:text>
					</xsl:attribute>
				</xsl:when>
				<xsl:otherwise>
					<xsl:attribute name="style">
						<xsl:text>background-color: #00FF00;</xsl:text>
					</xsl:attribute>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:value-of select="@callsonhold"/>
		</span>
	</xsl:template>
</xsl:stylesheet>

Open in new window

Avatar of gsfc

ASKER

I am so new to this I am not sure where to put this code in my page. I have attached the entire code for the page. I am not trying to get you to write this entire thing for me I really want to understand HOW its done. Just need some hand holding until I get there.
Anyway, I appreciate the help ALOT!
<!-- _lcid="1033" _version="..." _dal="1" --> <!-- _LocalBinding -->
 
<meta http-equiv="content-type" content="text/html; charset=utf-8"> 
 
<%@ Page language="C#"     Inherits="Microsoft.SharePoint.Portal.WebControls.WebPartPage,Microsoft.SharePoint.Portal,Version=11.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SPSSUBWC" Namespace="Microsoft.SharePoint.Portal.WebControls.Alerts" Assembly="Microsoft.SharePoint.Portal, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" dir="ltr"><!-- _locID@dir="ltr" _locComment="{L=!1025,1037}" -->
 
<head>
<meta name="WebPartPageExpansion" content="full">
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="WebPartPageDefaultViewPersonal" /> <meta http-equiv="expires" content="0"> 
<SPSWC:ShowMessageToNonScriptableClients runat="server"/> <meta name="generator" content="Microsoft SharePoint"> <meta name="ProgId" content="SharePoint.WebPartPage.Document"> <Title ID=onetidTitle><SPSWC:WebProperty Property="SiteTitle" runat="server" __Preview="GSFC Intranet"/> - <SPSWC:CategoryProperty runat="server" Property="Name" __Preview="VoiceNet_OnHold"/></Title> <script src="/_layouts/1033/owsbrows.js"></script> <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/ows.css"> <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/menu.css"> <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/sps.css"> 
<SPSWC:CustomCSSResourceElement runat="server"/> <!--begmstheme-->
<SharePoint:Theme runat="server"/><!--endmstheme--> <link type="text/xml" rel='alternate' href="_vti_bin/spdisco.aspx" /> <script> if (browseris.mac && !browseris.ie5up) { var ms_maccssfpfixup = "/_layouts/1033/styles/owsmac.css"; document.write("<link rel='stylesheet' Type='text/css' href='" + ms_maccssfpfixup + "'>"); } </script> <style> v\:* { behavior: url(#default#VML) } o\:* { behavior: url(#default#VML) } .shape { behavior: url(#default#VML) } </style>
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>
 
<body marginwidth="0" marginheight="0" scroll="yes" spsid="SitePageTemplate" id="PageBody" runat="server"> <form runat="server">  <table class="ms-main" cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
 
	 <tr> <td colspan="3" width="100%">
		<SPSWC:PageHeader id="PageHeaderID" runat="server" PageContext="SitePage" ShowTitle="false"/>
		<div class="ms-phnav1wrapper ms-navframe"> 
			<SPSWC:CategoryNavigationWebPart runat="server" id="HorizontalNavBar" DisplayStyle="HorizontalOneLayer"/> </div>
	</td> </tr> 
 
	 <tr> <td colspan="3" class="ms-titleareaframe"> <div class="ms-titleareaframe">
		<table width="100%" border="0" class="ms-titleareaframe" cellpadding="0" cellspacing="0"> <tr> <td> <table style="PADDING-LEFT: 2px;PADDING-TOP: 0px" cellpadding="0" cellspacing="0" border="0"> <tr>  <td align="middle" nowrap width="132" height="46" style="PADDING-TOP: 2px"> <img id="spsPageTitleIcon" src="/_layouts/images/spstopic.gif" alt=""> </td>  <td> <IMG SRC="/_layouts/images/blank.gif" width="15" height="1" alt=""> </td>  <td nowrap width="100%">  <table cellpadding="0" cellspacing="0"> <tr> <td nowrap class="ms-titlearea"> 
			<SPSWC:WebProperty Property="SiteTitle" runat="server"/> </td> </tr> <tr> <td ID="onetidPageTitle" class="ms-pagetitle"> 
				<SPSWC:CategoryProperty runat="server" Property="Name"/> </td> </tr> </table> </td>  <td align="right" valign="top"><!-- _locID@align="align3" _locComment="{Locked=!1025,1037}{ValidString=left,right}" --> <table cellpadding="0" cellspacing="0" height="100%"> <tr> <td colspan="5" nowrap align="right" valign="top"><!-- _locID@align="align4" _locComment="{Locked=!1025,1037}{ValidString=left,right}" --> 
				<SPSWC:RightBodySectionSearchBox runat="server" ContextSensitiveScopeType="1" SearchResultPageURL="SEARCH_HOME" FrameType="None" WebPart="true" __WebPartId="{872D2A39-63BB-42A8-9C8C-AEC64A39B7FD}"/> </td> </tr> <tr> <td colspan="5" nowrap align="right" class="ms-vb"><!-- _locID@align="align5" _locComment="{Locked=!1025,1037}{ValidString=left,right}" --> 
					<SPSWC:EditModeSettingsLink runat="server"/> </td> </tr> </table> </td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td height="2" colspan="5"><IMG SRC="/_layouts/images/blank.gif" width="1" height="1" alt=""></td> </tr> <tr> <td class="ms-titlearealine" height="1" colspan="5"><IMG SRC="/_layouts/images/blank.gif" width="1" height="1" alt=""></td> </tr> </table> </td> </tr> </table>
	</div> </td> </tr> 
 
	 <tr valign="top" height="100%">
 
		 <td id="webpartpagenavbar" widthchange="175" height="100%" class="ms-nav"> <table height="100%" border="0" cellpadding="0" cellspacing="0" class="ms-navframe"> <tr valign="top"> <td id="onetidWatermark" class="ms-navwatermark" dir="ltr">  </td> <td width="126" style="padding-right: 2px;">
				<SPSWC:BreadCrumbTrail runat="server" id="BreadCrumbTrail" TitleLocId=MultiPage_BreadcrumbWebPartTitle LeadInTextLocId="SiteForm_BreadCrumbTrail_LeadIn_Text" VerticalMode = "true" FrameType="None" WebPart="true" __WebPartId="{DE18B6E2-EDEF-4E76-A4D1-CC0C1DD88D78}"/>
				<SPSWC:CategoryNavigationWebPart runat="server" id="VerticalNavBar" DisplayStyle="VerticalOneLayer"/>
				<SPSWC:ToolBar runat="server" id="ActionBar" RenderIfEmpty="false" Orientation="Vertical" TitleLocId="CategoryManagement_ActionBar_Title_Text">
				<SPSWC:SubmitLinkToolBarButton runat="server" 
					id="TBBNewListing" 
					NavigateUrlFileContext="SiteAdminPage"
					NavigateUrlFileName="spnewlisting.aspx"
					TextLocId="CategoryManagement_ActionBar_Submit_Link_Text"
					ToolTipLocId="CategoryManagement_ActionBar_Submit_Link_Text"
					EditModeVisibility="Both"
					RequiredQueryStringParamsToInclude="CatID" />
				<SPSWC:SubmitLinkToolBarButton runat="server" 
					id="TBBNewPersonListing" 
					NavigateUrlFileContext="SiteAdminPage"
					NavigateUrlFileName="spnewlisting.aspx?Mode=Person"
					TextLocId="CategoryManagement_ActionBar_Submit_Person_Text"
					ToolTipLocId="CategoryManagement_ActionBar_Submit_Person_Text"
					EditModeVisibility="Both"
					RequiredQueryStringParamsToInclude="CatID" />
				<SPSWC:CreateSubCatToolBarButton runat="server" 
					id="TBBNewCategory" 
					NavigateUrlFileContext="SiteAdminPage"
					NavigateUrlFileName="spnewcategory.aspx"
					TextLocId="CategoryManagement_ActionBar_Create_SubCat_Text"
					ToolTipLocId="CategoryManagement_ActionBar_Create_SubCat_Text"
					EditModeVisibility="Both" 
					RequiredQueryStringParamsToInclude="CatID" />
				<SPSWC:AddDocumentToolBarButton runat="server" 
					id="TBBAddDoc" 
					TextLocId="CategoryManagement_ActionBar_UploadDoc_Text" 
					ToolTipLocId="CategoryManagement_ActionBar_UploadDoc_Text" 
					EditModeVisibility="Both" />
 
				<SPSWC:ToolBarSeparator runat="server" />
 
				<SPSWC:CatSettingsToolBarButton runat="server" 
					id="TBBEditDetail" 
					NavigateUrlFileContext="SiteAdminPage"
					NavigateUrlFileName="SPEditCategory.aspx?RetToCat=1"
					TextLocId="CategoryDetail_EditCategoryDetails_String_Text"  
					ToolTipLocId="CategoryDetail_EditCategoryDetails_String_Text"  
					EditModeVisibility="Both"
					RequiredQueryStringParamsToInclude="CatID" />
				<SPSWC:ManageSecurityToolBarButton runat="server" 
					id="TBBSecurity" 
					NavigateUrlFileContext="SiteAdminPage"
					NavigateUrlFileName="spcatsec.aspx"
					TextLocId="CategoryManagement_ActionBar_CategorySecurity_Text"  
					ToolTipLocId="CategoryManagement_ActionBar_CategorySecurity_Text"  
					EditModeVisibility="Both"
					RequiredQueryStringParamsToInclude="CatID" />
				<SPSWC:ManageContentToolBarButton runat="server" 
					id="TBBManageContent" 
					NavigateUrlFileContext="SiteAdminPage"
					NavigateUrlFileName="spsviewlsts.aspx"
					TextLocId="CategoryManagement_ActionBar_ManageCategoryContent_Text"  
					ToolTipLocId="CategoryManagement_ActionBar_ManageCategoryContent_Text"
					EditModeVisibility="Both"/>
				<SPSWC:CatSettingsToolBarButton runat="server" 
					id="TBBManageHierarchy" 
					NavigateUrlFileContext="SiteAdminPage"
					NavigateUrlFileName="catman.aspx"
					TextLocId="CategoryManagement_ActionBar_ManageHierarchy_Text"  
					ToolTipLocId="CategoryManagement_ActionBar_ManageHierarchy_Text"  
					EditModeVisibility="Both"
					RequiredQueryStringParamsToInclude="CatID" />
 
				<SPSWC:ToolBarSeparator runat="server" />
 
				<SPSWC:AddQuickLinkToolBarButton runat="server" 
					id="TBBPin" 
					TextLocId="QuickLinks_AddTo_Text" 
					ToolTipLocId="QuickLinks_AddTo_Text"
					EditModeVisibility="Both" />
				<SPSWC:CategoryAlertToolBarButton runat="server" 
					id="TBBSubscribeCategory" 
					TextLocId="CategoryManagement_ActionBar_Subscribe_To_Topic_Text" 
					ToolTipLocId="CategoryManagement_ActionBar_Subscribe_To_Topic_Text" 
					EditModeVisibility="Both" />
 
				<SPSWC:ToolBarSeparator runat="server" />
 
				<SPSWC:EditCategoryToolBarButton runat="server" 
					id="TBBViewEditToggle" 
					RequiredQueryStringParamsToInclude="CatID"
					EditModeVisibility="Both" />				
			</SPSWC:ToolBar>
 
		<img src="/_layouts/images/trans.gif" height="1" width="126" alt="" > </td> </tr> </table> </td> 
 
		 <td><IMG SRC="/_layouts/images/blank.gif" width="5" height="1" alt=""></td> <td class="ms-bodyareaframe" valign="top" width="100%">
			<SPSWC:PageLevelError runat="server" id="PageLevelError"/>
			<table border="0" cellpadding="0" cellspacing="0" ID="ZoneTable" width="100%" class="ms-tztable"> <tr ID="TopRow" > <td valign="top" ID="TopCell" width="100%" colspan="2" class="ms-tztop"> <WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="TopZone" Title="Top Zone" Orientation="Vertical">
<WebPartPages:DataViewWebPart runat="server" WebPart="true" __WebPartId="{F4CDCE24-DAF1-4497-8E81-E15F646697BA}" >
<WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title />
  <FrameType>None</FrameType>
  <Description />
  <IsIncluded>true</IsIncluded>
  <PartOrder>1</PartOrder>
  <FrameState>Normal</FrameState>
  <Height />
  <Width />
  <AllowRemove>true</AllowRemove>
  <AllowZoneChange>true</AllowZoneChange>
  <AllowMinimize>true</AllowMinimize>
  <IsVisible>true</IsVisible>
  <DetailLink />
  <HelpLink />
  <Dir>Default</Dir>
  <PartImageSmall />
  <MissingAssembly />
  <PartImageLarge />
  <IsIncludedFilter />
  <ExportControlledProperties>false</ExportControlledProperties>
  <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
  <XSL xmlns="http://schemas.microsoft.com/WebPart/v2/DataView"><![CDATA[
					<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl ddwrt msxsl" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ddwrt2="urn:frontpage:internal">
	<xsl:output method="html" indent="no"/>
						<xsl:param name="dvt_adhocmode"></xsl:param>
						<xsl:param name="dvt_adhocfiltermode">xsl</xsl:param>
						<xsl:param name="dvt_fieldsort"></xsl:param>
						<xsl:param name="dvt_sortfield"></xsl:param>
						<xsl:param name="dvt_groupfield"></xsl:param>
						<xsl:param name="dvt_groupdisplay"></xsl:param>
						<xsl:param name="dvt_sortdir">ascending</xsl:param>
						<xsl:param name="dvt_groupdir">ascending</xsl:param>
						<xsl:param name="dvt_grouptype"></xsl:param>
						<xsl:param name="dvt_sorttype">text</xsl:param>
						<xsl:param name="dvt_groupsorttype">text</xsl:param>
						<xsl:param name="dvt_filterfield"></xsl:param>
						<xsl:param name="dvt_filterval"></xsl:param>
						<xsl:param name="dvt_filtertype"></xsl:param>
						<xsl:param name="dvt_firstrow">1</xsl:param>
						<xsl:param name="dvt_nextpagedata"></xsl:param>
						<xsl:param name="dvt_apos">'</xsl:param>
						<xsl:param name="filterParam"></xsl:param>
						<xsl:template match="/">
							<xsl:call-template name="dvt_1"/>
	</xsl:template>
						<xsl:template name="dvt_1">
							<xsl:variable name="StyleName">Table</xsl:variable>
							<xsl:variable name="Rows" select="/ptQueryResponse/PassThrough_DataSet/PassThrough_DataSet_Row"/>
							<xsl:variable name="RowCount" select="count($Rows)"/>
							<xsl:variable name="IsEmpty" select="$RowCount = 0"/>
							<xsl:choose>
								<xsl:when test="$IsEmpty">
									<xsl:call-template name="dvt_1.empty"/>
			</xsl:when>
								<xsl:otherwise>
				<table border="0" width="100%" cellpadding="2" cellspacing="0">
					<tr valign="top">
						<th class="ms-vh" nowrap="" style="width: 257px">project</th>
						<th class="ms-vh" nowrap="" style="width: 101px">processid</th>
						<th class="ms-vh" nowrap="">callsonhold</th>
					</tr>
					<xsl:call-template name="dvt_1.body">
						<xsl:with-param name="Rows" select="$Rows"/>
						<xsl:with-param name="FirstRow" select="1"/>
						<xsl:with-param name="LastRow" select="$RowCount"/>
					</xsl:call-template>
				</table>
			</xsl:otherwise>
							</xsl:choose>
	</xsl:template>
						<xsl:template name="dvt_1.body">
							<xsl:param name="Rows"/>
							<xsl:param name="FirstRow"/>
							<xsl:param name="LastRow"/>
							<xsl:for-each select="$Rows">
								<xsl:variable name="KeepItemsTogether" select="false()"/>
								<xsl:variable name="HideGroupDetail" select="false()"/>
								<xsl:variable name="GroupStyle" select="'auto'"/>
								<xsl:if test="true()">
									<xsl:if test="not($HideGroupDetail)" ddwrt:cf_ignore="1">
					<tr style="display:{$GroupStyle}">
						<td class="ms-vb" style="width: 257px">
							<xsl:value-of select="@project"/>
						</td>
						<td class="ms-vb" style="width: 101px">
							<xsl:value-of select="@processid"/>
						</td>
						<td class="ms-vb">
							<span>
							<xsl:attribute name="style">
								<xsl:if test="number(@callsonhold) = '0'">
									<embed src="http://gsfcnet/_layouts/images/sound/doorslam.wav" autostart="1" loop="0" height="0" width="0"></embed>
								</xsl:if>
								<xsl:if test="number(@callsonhold) &gt; '0'">background-color: #FF0000; border: thick solid #0000FF; text-decoration: blink;</xsl:if>
							</xsl:attribute>
							<xsl:value-of select="@callsonhold" />
							</span></td>
					</tr>
				</xsl:if>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>
						<xsl:template name="dvt_1.empty">
							<xsl:variable name="ViewEmptyText">There are no items to show in this view.</xsl:variable>
		<table border="0" width="100%">
			<tr>
				<td class="ms-vb">
					<xsl:value-of select="$ViewEmptyText"/>
				</td>
			</tr>
		</table>
	</xsl:template>
</xsl:stylesheet>
					]]></XSL><DataQuery xmlns="http://schemas.microsoft.com/WebPart/v2/DataView"><![CDATA[
					<udc:ConnectionInfo xmlns:udc="http://schemas.microsoft.com/data/udc" Purpose="Query" UDCVersion="1.0" SOAPVersion="1.0">
						<udcs:Location xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" href="http://gsfcnet/C16/VoiceNetOnHold/_vti_bin/DspOleDb.asmx">OLEDBDataAdapter</udcs:Location>
						<udcs:SOAPAction xmlns:udcs="http://schemas.microsoft.com/data/udc/soap">http://schemas.microsoft.com/sharepoint/dsp/queryRequest</udcs:SOAPAction>
						<soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
							<dsp:queryRequest xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
								<dsp:ptQuery>
									<dsp:commandText resultContent="dataOnly" columnMapping="attribute" select="/">EXEC VoiceNetSystem.dbo.gsfc_CallOnHold;</dsp:commandText>
								</dsp:ptQuery>
							</dsp:queryRequest>
						</soap:Body>
						<soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
							<dsp:versions xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
								<dsp:version>1.0</dsp:version>
							</dsp:versions>
							<dsp:request xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" document="content" method="query"/>
							<dsp:connection xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
								<dsp:connectionString>Provider=SQLOLEDB;Data Source=vnsql;User ID=username;Password=password;</dsp:connectionString>
							</dsp:connection>
						</soap:Header>
					</udc:ConnectionInfo>]]></DataQuery><DataFields xmlns="http://schemas.microsoft.com/WebPart/v2/DataView">@project,project;@processid,processid;@callsonhold,callsonhold;</DataFields><ParamBindings xmlns="http://schemas.microsoft.com/WebPart/v2/DataView"><![CDATA[
					<ParameterBindings xmlns="http://schemas.microsoft.com/office/fpddw">
						<ParameterBinding Name="dvt_adhocmode" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_adhocfiltermode" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_fieldsort" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_groupfield" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_groupdisplay" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_groupdir" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_grouptype" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_sorttype" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_groupsorttype" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_filterfield" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_filterval" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_filtertype" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
						<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
						<ParameterBinding Name="filterParam" Location="Postback;Connection"/>
						<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
						<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
					</ParameterBindings>]]></ParamBindings><NoDefaultStyle xmlns="http://schemas.microsoft.com/WebPart/v2/DataView">TRUE</NoDefaultStyle></WebPart>
</WebPartPages:DataViewWebPart>
</WebPartPages:WebPartZone> <!-- _locID@Title="L_TopZone_Title" --> </td> </tr> <tr ID="MiddleRow"> <td valign="top" ID="MiddleLeftCell" width="100%" class="ms-tzmidleft"> <WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="MiddleLeftZone" Title="Middle Left Zone" Orientation="Vertical"></WebPartPages:WebPartZone> <!-- _locID@Title="L_MiddleLeftZone_Title" --> </td> <td valign="top" ID="MiddleRightCell" width="0%" class="ms-tzmidright"> <div class="ms-tzmrdiv"> <WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="MiddleRightZone" Title="Middle Right Zone" Orientation="Vertical"></WebPartPages:WebPartZone> <!-- _locID@Title="L_MiddleRightZone_Title" --> </div> </td> </tr> <tr ID="BottomRow" class="ms-tzbottom"> <td valign="top" ID="BottomCell" width="100%" colspan="2"> <WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="BottomZone" Title="Bottom Zone" Orientation="Vertical">
<WebPartPages:ContentEditorWebPart runat="server" WebPart="true" __WebPartId="{20BFFD6E-25DF-4F25-9EB4-FBCB31694B0C}" >
<WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>Content Editor Web Part</Title>
  <FrameType>None</FrameType>
  <Description>Use for formatted text, tables, and images.</Description>
  <IsIncluded>true</IsIncluded>
  <PartOrder>1</PartOrder>
  <FrameState>Normal</FrameState>
  <Height />
  <Width />
  <AllowRemove>true</AllowRemove>
  <AllowZoneChange>true</AllowZoneChange>
  <AllowMinimize>true</AllowMinimize>
  <IsVisible>false</IsVisible>
  <DetailLink />
  <HelpLink />
  <Dir>Default</Dir>
  <PartImageSmall />
  <MissingAssembly />
  <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
  <IsIncludedFilter />
  <ExportControlledProperties>false</ExportControlledProperties>
  <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
  <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
  <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[<script type="text/javascript" language="javascript">var reloadTimer = null;var sURL = unescape(window.location.pathname);function setReloadTime(secs){ if (arguments.length == 1)   { if (reloadTimer) clearTimeout(reloadTimer);       reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs)*1000));   }   else   { reloadTimer = null;     location.reload(true);     window.location.replace( sURL );   }}setReloadTime(30);</script>]]></Content>
  <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
</WebPart>
</WebPartPages:ContentEditorWebPart>
</WebPartPages:WebPartZone> <!-- _locID@Title="L_BottomZone_Title" --> </td> </tr> </table>
		</td> 
 
	</tr> 
</table>  </form> </body>
 
</html>

Open in new window

Wow.

The whole page would have to be rewritten. The reason being is that a body element or script tag has to be modified depending on whether or not @callsonhold > 0.

You could probably post this in C# area and have the C# portion perform this part of the operation.

Sorry.
ASKER CERTIFIED SOLUTION
Avatar of kmartin7
kmartin7
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
And let me know how it goes...
Avatar of gsfc

ASKER

Great, that got me VERY close to what I need. I changed a little bit of the code because the second embed statement made the wav file play EVERY time the page was refreshed. I have attached the code that I am using now.

The only other item is that now when any row changes to 1 or greater ALL rows change color, font, and plays the wav file multiple times. So, if there are 6 projects running and ONE project gets a caller on hold all 6 projects change colors and the wav file is played 6 times all at once.

However, thanks so much for your help so far this is as close as I have come to getting this to work. Any ideas on how to make sure it only plays once per row and only changes the color of the individual row that is greater than 1?

Thanks  again.
<xsl:choose>
                        		<xsl:when test="//@callsonhold  &gt; '0'">
                              		<xsl:attribute name="style">
                                    	<xsl:text>background-color: #FF0000; border: thick solid #0000FF; text-decoration: blink;</xsl:text>
                              </xsl:attribute>
                              <!-- change the following src attribute value to whatever sound signifies calls are on hold -->
                              <embed src="http://gsfcnet/_layouts/images/sound/tada.wav" autostart="1" loop="0" height="0" width="0"></embed>
                        </xsl:when>
                        		<xsl:otherwise>
                              		<xsl:attribute name="style">
                                    	<xsl:text>background-color: #00FF00;</xsl:text>
                              </xsl:attribute>
                              </xsl:otherwise>
                  			</xsl:choose>
                  <xsl:value-of select="@callsonhold"/>
            </span>

Open in new window

Just a shot in the dark, but change the following:

<xsl:when test="//@callsonhold  &gt; '0'">

to:

<xsl:when test="@callsonhold  &gt; '0'">

Sorry about that - I stuck it in there to test (not knowing your code structure)...

If this doesn't work you may need to ost an actual set of your XML code. We may need to use a for-each loop.
Avatar of gsfc

ASKER

That was it, once I removed the "//" the page started working exactly as I needed.
I would like to thank you for all your help with this, your directions were easy to understand and very helpful.