944,111 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 2845
  • ColdFusion RSS
Sep 4th, 2006
0

SSI and CGI : Capture a value?

Expand Post »
This isn't an SSI or a CGI board, but I hear ColdFusion is quite SSI related, and it's the best place for this question I hope.

I'm wondering if it's possible to do something like this:

"html" page (actually XSL transformed XML page) has an SSI #include or #exec, then an SSI #if statement that does "something" based on a computation in the CGI...

Here's my questions with relation to that..

If I nest SSI functions will they be called in child > parent order or parent > child order? Can I read/write form/environment parameters in the CGI and read them back in the SSI #if?

I may have no need to do this eventually, but I only want my target modder-base to need to alter XSL files (to change style etc) and not look at CGI scripts... CSS is ok but not quite good enough, and I don't want to "read" XSL files in the CGI to simulate seamlessness... Any helper will get big shouts on my new site!

^_-

Matt
Similar Threads
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006
Sep 5th, 2006
0

Re: SSI and CGI : Capture a value?

It was very simple actually. I didn't need to use SSI #ifs atall! The file gets parsed before the XSLT does any work, so:

ColdFusion Syntax (Toggle Plain Text)
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="<a rel="nofollow" href="http://www.w3.org/1999/XSL/Transform" target="_blank">http://www.w3.org/1999/XSL/Transform</a>" version="1.0">
  3. <xsl:template name="logincontrols">
  4.  
  5. <xsl:variable name="userID"><!--#include virtual="../../cgi/sustain.cgi"--></xsl:variable>
  6.  
  7. <xsl:choose>
  8. <xsl:when test="$userID = '-1'">
  9. [Display some login-related info here]
  10. </xsl:when>
  11. <xsl:otherwise>
  12. [Display some user-specific info here]
  13. </xsl:otherwise>
  14. </xsl:choose>
  15. </xsl:template>
  16.  
  17. </xsl:stylesheet>

works just fine, because by the time the template is called, the user's id number (or -1) for null is in that variable. Pretty cool, pretty cool. I have a custom MIME type "SSIXSL" to avoid parsing every XSL file every time...

XSL is pretty fantastic.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: Navigate back to Search Results
Next Thread in ColdFusion Forum Timeline: Personal preferance question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC