comparison tests/url.ur @ 770:c125df6fabfc

Runtime URL and MIME type filtering
author Adam Chlipala <adamc@hcoop.net>
date Sat, 02 May 2009 18:20:15 -0400
parents e28637743279
children
comparison
equal deleted inserted replaced
769:efceae06df17 770:c125df6fabfc
1 val url = "http://www.yahoo.com/"
2
3 fun readersChoice r = return <xml><body> 1 fun readersChoice r = return <xml><body>
4 <a href={bless r.Url}>Your pick, boss</a> 2 {case checkUrl r.Url of
3 None => <xml>I can't do that, Dave.</xml>
4 | Some url => <xml><a href={url}>Your pick, boss</a></xml>}
5 </body></xml> 5 </body></xml>
6 6
7 fun main () : transaction page = return <xml><body> 7 fun main () : transaction page = return <xml><body>
8 <a href="http://www.google.com/">Google!</a> 8 <a href="http://en.wikipedia.org/wiki/Wikipedia:About">Learn</a>
9 <a href={bless url}>Yahoo!</a><br/>
10 <br/> 9 <br/>
11 10
12 <form><textbox{#Url}/> <submit action={readersChoice}/></form> 11 <form><textbox{#Url}/> <submit action={readersChoice}/></form>
13 </body></xml> 12 </body></xml>