Diff for /parser3/www/htdocs/Attic/index.html between versions 1.66 and 1.82

version 1.66, 2002/06/11 14:14:16 version 1.82, 2002/06/28 09:59:03
Line 1 Line 1
 #@USE  #@USE
 #t.p  #t.p
   
 @autoZ[]  @auto[filespec]
   $selffilespec[$filespec]
 #$form:here  #$form:here
 $request:charset[windows-1251]  $request:charset[windows-1251]
 $response:charset[windows-1251]  $response:charset[windows-1251]
Line 12  $response:content-type[$.value[text/html Line 13  $response:content-type[$.value[text/html
 #$result[123]  #$result[123]
   
 @main[]  @main[]
   #$a(123)
   #^a.format[%.10u]
   #$result[111]
   #^f[a]
 #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{  #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
 #       ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>  #       ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
 #    ^string:sql{select news_id from news where news_id=-1}[$.default{2}]  #    ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
Line 161  $response:content-type[$.value[text/html Line 166  $response:content-type[$.value[text/html
 #^checkList[]  #^checkList[]
 #^datetest[]  #^datetest[]
 #^tserge[]  #^tserge[]
 ^envt[]  #^envt[]
   #^selectt[]
   #^select2[]
   #^selectSingle2[]
   #^selectString2[]
   #^selectNumber2[]
   #^selectBool2[]
   #^xdoccreate[]
   #^xdoccreatetag[]
   #^xdocload[]
   #^xdocstring[]
   #^xdocsave[]
   #^div[]
   #^datecreatestring3[]
   #^tfilespec[]
   #^tcrypt[]
   #^cryptdocsample[]
   #^sendtests[]
   #^tnormalize[]
   ^xmltransformbyxdoc[]
   #^sergestrandef[]
   <hr>
   OK
   
   @sergestrandef[]
   $sQuantity[ ]
   ^sQuantity.int(10)
   
   @xmltransformbyxdoc[]
   $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
   <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
   <people>
           <man id="1" имя="word слово">
                   <name>1  2</name>
           </man>
   </people>
   }}]
   $sheet[^xdoc::create{<?xml version="1.0"?> 
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
   
   >
   <!--<xsl:output doctype-public ="-//W3C//DTD XHTML" indent="yes"/>-->
   
           <!--<xsl:import href="http://localhost/html.xsl"/>-->
           <xsl:import href="html.xsl"/>
   
   <xsl:param name="param1">defparam1</xsl:param>
   <xsl:param name="param2">defparam2</xsl:param>
   
   
           <xsl:template match="doc">
                   param1=<xsl:value-of select="^$param1"/><br/>
                   param2=<xsl:value-of select="^$param2"/><br/>
   
                   test return <something background=""/>
           </xsl:template>
   
           <xsl:template name="test">
                   test return3
           </xsl:template>
   
     <xsl:template match="people">
        <html>
        <head>z</head>
                   para1=<xsl:copy-of select="^$param1"/>
           <xsl:apply-templates/>
           <hr/>
           <xsl:call-template name="test"/>
        </html>    
     </xsl:template>
   
     <xsl:template match="name">
       <b><xsl:value-of select="."/></b>
     </xsl:template>
   </xsl:stylesheet>
   }]
   
   
   $xdoc[^xdoc.transform[$sheet]]
   $string[^xdoc.string[$.method[html]]]
   ^string.save[a]
   ^untaint[html]{$string}
   
   
   
   @tnormalize[]
   #s состоит из 1000 фрагментов
   $s[^for[i](0;999){фрагмент }]
   #это займет много ресурсов
   ^s.match[фраг][g]{перга}
   #это займет меньше ресурсов
   #$normalized[^s.normalize[]]
   #^normalized.match[фраг][g]{перга}
   
   @sendtests[]
   #^text[]
   #^html[]
   #^text-n-html[]
   #^file[]
   #^text-n-file[]
   ^text-n-html-n-file[]
   #^backwardcomp[]
   
   @backwardcomp[]
   ^mail:send[
           $.from[paf]
           $.to[paf]
           $.body[this is text value]
   ]
   
   @text[]
   ^mail:send[
           $.from[paf]
           $.to[paf]
           $.text[
                   $.value[this is text value]
           ]
   ]
   
   @html[]
   ^mail:send[
           $.from[paf]
           $.to[paf]
           $.html{this is <b>html</b> value ^taint[<] 10}
   ]
   
   @text-n-html[]
   ^mail:send[
           $.from[paf]
           $.to[paf]
           $.text[
                   $.value[this is text value]
           ]
           $.html[
           $.value{this is <b>html</b> value ^taint[<] 10}
           ]
   ]
   
   @file[]
   ^mail:send[
           $.from[paf]
           $.to[paf]
           $.file[^file::load[binary;image.jpg]]
   ]
   
   @text-n-file[]
   ^mail:send[
           $.from[paf]
           $.to[paf]
           $.text[
                   $.value[this is text value]
           ]
           $.file[^file::load[binary;image.jpg]]
   ]
   
   @text-n-html-n-file[]
   ^mail:send[
           $.from[paf]
           $.to[paf]
           $.text[
                   $.value[this is text value]
           ]
           $.html[
           $.COntent-type[$.value[text/html]$.charset[windows-1251xx]]
           $.value{this is <b>html</b> value ^taint[<] 10}
           ]
           $.file[^file::load[binary;image.jpg]]
   ]
   
   
   
   @md5salt[]
   1234
   
   @cryptdocsample[]
   $users[^table::create{name      password
   alice   ***
   bob     ***
   }]
   
   $htpasswd[^table::create[nameless]{}]
   ^users.menu{
           ^htpasswd.append{$users.name:^math:crypt[$users.password;^$apr1^$^md5salt[]]}
   }
   
   ^htpasswd.save[nameless;.htpasswd-parser-test]
   
   
   @tcrypt[]
   #^math:crypt[123;^$apr1^$1234567890abcdef]<br>
   ^math:crypt[123;^$apr1^$]<br>
   
   @tfilespec[]
   src=$selffilespec<br>
   dirname=^file:dirname[$selffilespec]<br>
   basename=^file:basename[$selffilespec]<br>
   justname=^file:justname[$selffilespec]<br>
   justext=^file:justext[$selffilespec]<br>
   
   @datecreatestring3[]
   $new_after[^date::now(-3)]
   $articles[^table::create{id     title   last_update
   1       привет  2002-07-03}]
   ^articles.menu{
       $last_update[^date::create[$articles.last_update]]
       <a href=${articles.id}.html>$articles.title</a>
       ^if($last_update > $new_after){новая}
       <br>
   }
   
   @div[]
   $var(5)
   ^var.inc(7)
   ^var.dec(3)
   ^var.div(4)
   ^var.mul(2)
   $var
   
   
   @xdocsave[]
   $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
   <document>
   строка1<br/>
   строка2<br/>
   </document>}]
   ^document.save[test.xml]
   
   @xdocstring[]
   $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
   <document>
   строка1<br/>
   строка2<br/>
   </document>}]
   ^document.string[
       $.method[html]
   ]
   
   
   @xdocload[]
   $document[^xdoc::load[article.xml]]
   $response:body[^document.file[$.media-type[text/xml]]]
   
   
   @xdoccreatetag[]
   $document[^xdoc::create[document]]
   $paraNode[^document.createElement[para]]
   $dummy[^document.documentElement.appendChild[$paraNode]]
   $response:body[^document.file[$.media-type[text/xml]]]
   
   
   @xdoccreate[]
   $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
   <document>
   текст
   </document>}]
   $response:body[^document.file[$.media-type[text/xml]]]
   
   @selectBool2[]
   $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
   <t attr="привет" n="123"/>}]
   ^if(^d.selectBool[/t/@n > 10]){
       /t/@n больше 10
   }{
       не больше
   }
   
   
   @selectNumber2[]
   $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
   <t attr="привет" n="123"/>}]
   ^d.selectNumber[number(/t/@n)+1]<br>
   ^d.selectNumber[2*2]<br>
   
   
   @selectString2[]
   $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
   <t attr="привет" n="123"/>}]
   # результат=привет
   ^d.selectString[string(t/@attr)]
   
   
   @selectSingle2[]
   $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
   <t attr="привет" n="123"/>}]
   # результат=один элемент "t"
   $element[^d.selectSingle[t]]
   # результат=2 (количество атрибутов <t>)
   Количество атрибутов: ^element.attributes._count[]<br>
   # результат=не существует (нет <x>)
   ^if(^d.select[x]){
       x существует
   }{
       x не существует
   }
   
   @select2[]
   $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
   # результат: список из одного элемента "t"
   $list[^d.select[t]]
   # результат: 2 = количество атрибутов <t>
   ^list.0.attributes._count[]<br>
   ^for[i](0;$list-1){
       $attr[$list.$i]
       $attr.nodeName = $attr.nodeType<br>
   }
   
   
   @selectt[]
   $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
   $list[^d.select[t]]
   ^list.0.attributes._count[]
   
 @envt[]  @envt[]
 $f[^file::exec[showenv.cmd;  $f[^file::exec[showenv.cmd;

Removed from v.1.66  
changed lines
  Added in v.1.82


E-mail: