ASP in XSL Document

D

David

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 &gt;. 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.
 
M

Martin Honnen

David said:
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 &gt;. 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/d...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/d...html/2a5dbaae-bccb-4d5e-aa30-4a2c1bcc79ce.asp>

Finally you can pass in extension objects and call their methods:
<http://msdn.microsoft.com/library/d...html/106f85e4-6aa4-44ce-945a-23b2143586d2.asp>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top