David wrote:
First of all, yes we are still using classic ASP, lol. I have a XSL
document that is reading in info from a XML file. I have to display
serveral server side dates on the page. Is there anyway to use ASP
code inside a XSL document.
I have tried the following.
<![CDATA[ <%=Date()%]]>
This does not work. In the view source the < and get changed to
&ls; and >. Is this possible? Is there any other way to read a
server side date from this xsl page? If not I will have to re design
the hole page. Thanks for the help.
If you are using MSXML to perform the XSLT transformation then you have
several choices, you can use stylesheet parameters (top level xsl:param
elements in the form e.g.
<xsl:param name="current-date"/>
) then when scripting the transformation with MSXML you can set such
parameters before the transformation is being run:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/9ddcd728-2646-494a-8fa4-3b68e8c032b7.asp>
It is also possible to write extension functions with JScript or
VBScript that you can call then in the stylesheet, check the
msxsl:script element documentation:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/2a5dbaae-bccb-4d5e-aa30-4a2c1bcc79ce.asp>
Finally you can pass in extension objects and call their methods:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/106f85e4-6aa4-44ce-945a-23b2143586d2.asp>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/