Re: name:variable

Sovande Ulv <[email protected]>
Newsgroups gmane.text.clearsilver.general
Message-ID <[email protected]>
On Nov 29, 2007, at 4:23 PM, Nikolai Kondrashov wrote:

> For example, why not replace dashes with dots and place the  
> resulting tree
> under the same "HTTP" branch.
>
> So, "Accept-Language" header value would be stored in
> "HTTP.Accept.Language". At the same time, it would not interfere  
> with the
> present scheme.


The whole point of using the actual name of a Request header is that  
it is "nicer" to use. For instance, if I want to list all headers I  
can do this;

  <?cs each:header = Request.Header ?>
	<li> <?cs var:header.name ?> = <?cs var:header.value ?>
<?cs /each ?>

Request Headers:
	• Host = localhost:8080
	• Connection = keep-alive
	• Accept-Encoding = gzip, deflate
	• Accept-Language = en-us
	• Accept = text/xml,application/xml,application/xhtml+xml,text/html
	• Referer = http://localhost:8080/examples/serverpages/index.csp
	• User-Agent = Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us)

Note that this prints the real header name, not "AcceptEncoding", or  
for that matter "Accept.Encoding". Its easy to mangle names on-the-fly  
when putting them into the HDF data set. That's not the point, my  
point is that I want to report the _actual_ header name not some  
mangled version.  But, as we have discussed <?cs  
var:Request.Header.Accept-Encoding ?>  does not work for obvious  
reasons. Working on the patch I have come to the conclusion that it is  
me that is unreasonable and that I should just mangle the header  
names[1] and go on.

Thanks for the suggestion, but having "Request.Header.Accept.Language"  
instead of "Request.Header.Accept_Language" does not look much better  
to me, in fact the latter is better since it does not add an extra HDF  
node to the parse tree and save one step when looking up nodes.

[1] I could of course change the name function in clearsilver and  
unmangle the name there, but its probably not wort it and can have  
side effects. 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ClearSilver/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ClearSilver/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.