|
|
| version 1.10, 2004/02/25 13:40:23 | version 1.35, 2004/03/25 11:51:19 |
|---|---|
| Line 1 | Line 1 |
| @main[] | @auto[] |
| $request:charset[UTF-8] | $request:charset[windows-1251] |
| #$response:charset[UTF-8] | |
| $response:charset[windows-1251] | $response:charset[windows-1251] |
| $response:content-type[$.value[text/html]$.charset[$response:charset]] | |
| $xdoc[^xdoc::create{<?xml version="1.0" encoding="$request:charset"?> | |
| <doc attribute="a | @main[] |
| b"> | $table[^table::create{pet |
| исходный | cat milk}] |
| </doc> | $hash[^table.hash[pet]] |
| ^display[$hash] | |
| @main[] | |
| ^connect[mysql://root@localhost/paf]{ | |
| $hash[^hash::sql{select 'cat' as pet | |
| #, 'milk' as food | |
| }] | }] |
| $xdoc[^xdoc.transform[_bug.xsl]] | |
| ^xdoc.string[] | |
| #^xdoc.save[_bug-koi.xml;$.encoding[koi8-r]] | |
| #^xdoc.save[_bug-in-request-charset.xml] | |
| <hr> | |
| $request:charset/$response:charset | |
| ^display_hash[$hash] | |
| } | |
| @main[] | |
| ^connect[mysql://root@localhost/paf]{ | |
| $participants[^hash::sql{select 'feodor' as participant }] | |
| } | |
| #: : | |
| $participantsZ[ | |
| $.alex(1) | |
| $.boris(1) | |
| ] | |
| #: , , : | |
| $person[feodor] | |
| $person ^if($participants.$person){}{ } | |
| } | |
| @display_hash[hash] | |
| #$hash.a.a | |
| ^hash.foreach[k;v]{hash $k=( | |
| ^if($v is hash){^display_hash[$v]}{ | |
| ^if($v is bool){bool ^if($v){true;false}}{string $v} | |
| } | |
| }[,] | |
| )^#0A}] | |
| @main[] | |
| $name[ ] | |
| "$name" | |
| "^name.trim[]" | |
| $path[/section/subsection/] | |
| ^path.trim[end;/] | |
| @main[] | |
| $xdoc[^xdoc::create{<?xml version="1.0"?> | |
| <document xmlns:s="urn:special"> | |
| <s:code>string</s:code> | |
| </document> | |
| }] | |
| $xdoc.search-namespaces.s[urn:special] | |
| ^xdoc.selectString[string(//s:code)] |