[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Reading Cookies During XSL Transformation (problems)..

Subject: Reading Cookies During XSL Transformation (problems)...
From: Michael <msell@xxxxxxxxxxxxxxx>
Date: Sat, 23 Oct 2004 03:41:47 +1000
xsl cookies
When trying to read cookies with both JavaScript or VBScript I end up with errors. I have a suspicion that this is because the "document" object does not get defined until after the transformation of the XSL document. I need to know if there is a way to obtain cookie data without accessing the document object.

Additionally, it seems that when using JavaScript, returning string data of any kind through a function returns a data type error. The MSXSL parser displays the following: "Function 'getCookie' did not return a value, or it returned a value that cannot be converted to an XSL data type."

Any help solving these problems would be a miracle. Below is the relevant coding snippets in both JavaScript and VBScript...

JavaScript:

<msxsl:script language="javascript" implements-prefix="js">
 function getCookie(cookieName)
 {
   result = document.cookie;
 }
</msxsl:script>

<script language="javascript">
 function setCookie(cookieName, cookieValue)
 {
   document.cookie = cookieName + "=" + cookieValue;
 }
</script>

<form name="search_by_keyword">
<input type="text" name="keyword" onChange="setCookie('Keyword', search_by_keyword.keyword.value)" />
</form>


VBScript:

<msxsl:script language="vbscript" implements-prefix="vbs">
<![CDATA[
 function topic()
   topic = document.cookie
 end function
]]>
</msxsl:script>

<script language="vbscript">
sub topic_onchange
tomorrow = dateadd("d", 1, date())
expiry_date = weekdayname(weekday(tomorrow)) + " , " + cstr(tomorrow) + " " + cstr(time()) + " CST"
document.cookie = "topic = " + search_by_topic.topic.value + "; expires = " + expiry_date
end sub
</script>


<div class="test"><xsl:value-of select="vbs:topic()" /></div>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.