Forum Moderators: open

Message Too Old, No Replies

ASP & XSL

how to integrate

         

mattglet

7:45 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is it possible to call an asp variable from within XSL content?
example:
<xsl:variable name="var" select="'<%=date%>'" />

i get an error when i try this... i've also tried "'<script language...'", but that didn't work either (didn't know if it was the %'s). any ideas?

korkus2000

7:50 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Did you add xsl to the iis manager so the asp dll also handles xsl?

mattglet

8:01 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



will this at all affect any processing of any xml documents by xsl?

korkus2000

8:03 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know never tried it. Where are you processing the xsl client or server-side? I believe adding the extension is the only way to ad asp to the page though.

mattglet

8:06 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



serverside... so you're probably right

mattglet

8:08 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



actually... using the <xsl:param> command might work... let me read into it, and i'll post the results.

mattglet

8:22 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



new problem:
<xsl:when test = "Blah = $param">
<td class = "content" colspan = "3">
</xsl:when>

i get the error:
End tag 'xsl:when' does not match the start tag 'td'.

how do you output html in between the xsl:when? i've tried using <xsl:test disable-output-escaping="no"> (and "yes"), to no avail.

Xoc

2:28 pm on Mar 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That particular problem is because the XML has to be well-formed. You have a <td> tag with no closing </td> within the <xsl:when>. You have to perform complete operations.

As for the HTML output, add this to just below the <xsl:stylesheet> tag:


<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" standalone="no"/>

As for the original question, it depends on when you are processing the XML. If it is in the call to the ASP page, the ASP processing has already been performed when the XSL transformation has been done. If so, then you need to pass in a variable as shown in the previous post.

If, on the other hand, you are processing the XML somewhere else and trying to produce an ASP page, then I think the problem is that you need to use entities for < and >. & gt; and & lt; (remove the space after the ampersand).

macrost

2:33 am on Mar 10, 2003 (gmt 0)

10+ Year Member



Matt,
When you are using the <xsl:when> is it wrapped within an <xsl:choose>?
Mac

mattglet

5:36 am on Mar 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i've solved most of my problems, now just on to the technicalities... mac, IM me when you get a chance, i have some questions for you.