--- parser3/operators.ru.txt 2002/04/09 15:56:35 1.32 +++ parser3/operators.ru.txt 2002/06/14 15:22:45 1.47 @@ -231,7 +231,7 @@ odbc c:\drives\y\parser3project\odbc\ !^имя.div(на сколько /) !^имя.mod(на сколько %) !^имя.format[формат] - !^int/double:sql{query}[[$.limit(2) $.offset(4) $.default(0)]] + !^int/double:sql{query}[[$.limit(2) $.offset(4) $.default{0}]] запрос, результат которого должен быть один столбец/одна строка !string @@ -243,7 +243,7 @@ odbc c:\drives\y\parser3project\odbc\ пример: ^if(def $form:name) не пуста? ^if($user.isAlive) истина? [автопреобразование к числу, не ноль?] - !^string::sql{query}[[$.limit(2) $.offset(4) $.default[n/a]]] + !^string::sql{query}[[$.limit(2) $.offset(4) $.default{n/a}]] результат запроса должен быть один столбец/одна строка !^имя.int[] .int(default) целочисленное значение строки. если ломается преобразование, берётся default @@ -283,7 +283,7 @@ odbc c:\drives\y\parser3project\odbc\ !^table::load[[nameless;]путь] !если не nameless, названия колонок берутся из первой строки !пустые строки, и строки в первой колонке содержащие '#', игнорируются - !^table::sql{query}[[$.limit(2) $.offset(4)]] + !^table::sql{query}[[$.limit(2) $.offset(4) todo:$.default{ ^table::create[...] }]] !^таблица.save[[nameless|append;]путь] !$таблица.поле !$таблица.fields+ из named таблицы выдаёт текущую запись как Hash @@ -309,9 +309,9 @@ odbc c:\drives\y\parser3project\odbc\ значением $hash.ключ будет hash в котором поля значений будут ключами поля значений могут быть не указаны, тогда ими будут все столбцы, включая ключевой !^таблица.columns[]+ таблица из одного столбца $column - $отфильтрованное[^таблица.filter(выражение)] - $adults[^man.filter($man.age>=18)] - + !$отобранное[^таблица.select(выражение)] = таблица из тех же столбцов и строк, у которых условие совпало + $adults[^man.select($man.age>=18)] + ^таблица.color[цвет1;цвет2] !hash @@ -331,7 +331,7 @@ odbc c:\drives\y\parser3project\odbc\ !^a.intersection[b] = пересечение значения a !^a.intersects[b] = bool - !^hash::sql{запрос}[[$.limit(2) $.offset(4)]] + !^hash::sql{запрос}[[$.limit(2) $.offset(4) todo:$.default{$.field[]...}]] получается hash(ключи=значения первая колонка ответа) of hash(ключи=названия остальных колонкок ответа) !^hash._keys[]+ таблица из одного столбца $key @@ -538,7 +538,7 @@ Xhashfile разблокируется Xchmod[...] НЕТ И НЕ БУДЕТ, ЧТОБЫ НЕ МОГЛИ СДЕЛАТЬ executable и запустить, даже если ftp запрещает chmod. -!math +math !$math:PI !^math:round floor ceiling !^math:trunc frac @@ -548,6 +548,8 @@ Xhashfile !^math:degrees radians !^math:pow sqrt !^math:random(ширина диапазона) + ^math:{C2C0983C-E26E-4169-BD07-77ECE9405BA5} + !date !время типа time можно использовать в выражениях, подставляет @@ -558,9 +560,12 @@ Xhashfile !^date::now(смещение в днях) выдаёт сейчас+смещение !^date::create(дней с epoch) // старое имя set !^date::create(year;month[;day[;hour[;minute[;second]]]]) // старое имя set - ^date::sql-create[дата в формате %Y-%m-%d %H:%M:%S] + !^date::create[дата в формате %Y-%m-%d %H:%M:%S] для удобного создания по значению из базы - !$date.year month day hour minute second weekday read-only + формат1: %Y[-%m[-%d[ %H[:%M[:%S]]]]] + формат2: %H:%M[:%S] + !$date.year month day hour minute second weekday todo:yearday + read-only !^date.roll[year|month|day](+-смещение) сдвигает дату !^date.sql-string[] %Y-%m-%d %H:%M:%S where published='$дата.sql-string[]' @@ -597,7 +602,7 @@ xdoc(xnode) !равно текущей кодировке выходной страницы, $response:charset ::sql{...} - !::create{} старое имя 'set' + !::create{} старое имя 'set' !::create[qualifiedName] !::load[file.xml] !.transform[rules.xsl][[params hash]] выдаёт dom @@ -618,9 +623,9 @@ xdoc(xnode) !media-type = string /> !параметры передаются как есть, не xpath выражения - !.string[output options] - !.save[file.xml;output options] с шапкой - !.file[output options] = file + !.string[[output options]] + !.save[file.xml[;output options]] с шапкой + !.file[[output options]] = file output options идентичны атрибутам xsl:output [исключение: игнорируется cdata-section-elements, нужно будет, сделаю] выдаёт media-type при подстановке $response:body[сюда] @@ -657,10 +662,15 @@ xdoc(xnode) true if the attribute received its value explicitly in the XML document, or if a value was assigned programatically with the setValue function. false if the attribute value came from the default value declared in the document's DTD. + !$attribute_node.name + !$attribute_node.value $text_node/cdata_node/comment_node.substringData !$pi_node.target = target of this processing instruction XML defines this as being the first token following the markup that begins the processing instruction. + !$pi_node.data = The content of this processing instruction + This is from the first non white space character after the target + to the character immediately preceding the ?>. document_node. readonly attribute DocumentType doctype readonly attribute DOMImplementation implementation @@ -687,7 +697,7 @@ xdoc(xnode) !void removeAttribute(in DOMString name) raises(DOMException) !Attr getAttributeNode(in DOMString name) !Attr setAttributeNode(in Attr newAttr) raises(DOMException) - !/*Attr*/ removeAttributeNode(in Attr oldAttr) raises(DOMException) + !Attr removeAttributeNode(in Attr oldAttr) raises(DOMException) !NodeList getElementsByTagName(in DOMString name) !void normalize() @@ -700,9 +710,9 @@ xdoc(xnode) !^node.select[xpath/query/expression] = array of nodes, empty array if nothing found !^node.selectSingle[xpath/query/expression] = first node if any - !^node.selectBool[xpath/query/expression] = bool if any - !^node.selectNumber[xpath/query/expression] = double if any - !^node.selectString[xpath/query/expression] = string if any + !^node.selectBool[xpath/query/expression] = bool if any or die + !^node.selectNumber[xpath/query/expression] = double if any or die + !^node.selectString[xpath/query/expression] = string if any or die !error codes(пока придут как текст в случае соответствующих ошибок): INDEX_SIZE_ERR @@ -784,14 +794,11 @@ xdoc(xnode) кучи auto.p и запрашиваемого документа: !parser3.conf cgi: - 1. или полный путь из переменной окружения HTTP_PARSER_ROOT_CONFIG - или configure sysconfdir|windows directory - 2. или полный путь из переменной окружения HTTP_PARSER_SITE_CONFIG + 1. или полный путь из переменной окружения CGI_PARSER_SITE_CONFIG или рядом с бинарником parser'а isapi: windows directory apache module: - 1) ParserRootConfig [httpd.conf only] - 2) ParserSiteConfig [can be in .htaccess] + 1) ParserConfig [can be in .htaccess] !auto.p вниз от DOCUMENT_ROOT/ по дереву до каталога с обрабатываемым файлом включительно класс собирается из всех этих файлов, последующие становятся родителями предыдущих имя последнего загруженного MAIN, имён у предыдущих нет @@ -816,6 +823,7 @@ xdoc(xnode) !parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...) !number.zerodivision ^eval(1/0) ^eval(1%0) !number.format ^eval(abc*5) + !file.lock shared/exclusive lock error !file.missing ^file:delete[delme] not found !file.access ^table::load[.] no rights !image.format ^image::measure[index.html] not gif/jpg