Module REXML::Functions
In: rexml/functions.rb

If you add a method, keep in mind two things:

(1) the first argument will always be a list of nodes from which to filter. In the case of context methods (such as position), the function should return an array with a value for each child in the array.

(2) all method calls from XML will have "-" replaced with "_". Therefore, in XML, "local-name()" is identical (and actually becomes) "local_name()"

もし、あなたがメソッドを追加するなら、二つのことを覚えておいて下さ い。

(1)最初の引数は常にフィルターにかけられたノードのリストでしょう。 (positionのような)コンテキストメソッドの場合、関数は配列のそれぞれ の子の値と共に配列を返すべきです。

(2)XML文書から呼ばれる全てのメソッドは"_"と置き換えられた"-"を持っ ているでしょう。したがって、XML文書の中では、"local-name()"は "local_name()"と同じです(そして、実際にそうなります)。

Methods
boolean    ceiling    compare_language    concat    contains    count    false    floor    get_namespace    id    lang    last    local_name    method_missing    name    namespace_context    namespace_context=    namespace_uri    node    node=    normalize_space    not    number    pair    pair=    position    round    starts_with    string    string_length    substring    substring_after    substring_before    sum    text    translate    true    variable    variable=   
Public Class methods
node=(value)
pair=(value)
variable=(value)
namespace_context=(value)
node()
pair()
variable()
namespace_context()
text( )
last( )
position( )
count( node_set )
id( object )

Since REXML is non-validating, this method is not implemented as it requires a DTD

REXMLは妥当性を検証しないので、このメソッドはDTDを要求するように インプリメントされていません。

local_name( node_set=nil )

NOT TESTED

テストされていません。

namespace_uri( node_set=nil )

NOT TESTED

テストされていません。

name( node_set=nil )
get_namespace( node_set = nil ) {|@@node if @@node.kind_of? Namespace| ...}

Helper method.

ヘルパーメソッドです。

string( object=nil )

A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.

A number is converted to a string as follows

NaN is converted to the string NaN

positive zero is converted to the string 0

negative zero is converted to the string 0

positive infinity is converted to the string Infinity

negative infinity is converted to the string -Infinity

if the number is an integer, the number is represented in decimal form as a Number with no decimal point and no leading zeros, preceded by a minus sign (-) if the number is negative

otherwise, the number is represented in decimal form as a Number including a decimal point with at least one digit before the decimal point and at least one digit after the decimal point, preceded by a minus sign (-) if the number is negative; there must be no leading zeros before the decimal point apart possibly from the one required digit immediately before the decimal point; beyond the one required digit after the decimal point there must be as many, but only as many, more digits as are needed to uniquely distinguish the number from all other IEEE 754 numeric values.

The boolean false value is converted to the string false. The boolean true value is converted to the string true.

An object of a type other than the four basic types is converted to a string in a way that is dependent on that type.

ノードセットは最初のXML文書の要望によりノードの文字列の値を返す ことによって文字列に変換されます。もし、ノードセットが空ならば、 空文字か返されます。

数字は以下のように文字列に変換されます。

NaNは文字列Nanに変換されます。

正のゼロは文字列の0に変換されます。

負のゼロは文字列の0に変換されます。

正の無限大は文字列Infinityに変換されます。

負の無限大は文字列-Infinityに変換されます。

もし、数字が整数ならば、数字は小数点は無く、それに伴うゼロも無い が、もし、負の数ならばマイナスの記号(-)が付くNumberのような十進 法の形式で表現されます。

さもなければ、数字は小数点と、その前後に少なくとも一つの数字と、 もし、数字が負の数ならばマイナスの記号(-)が付くNumberのような十進 法の形式で表現されます。;小数点の前には多分、小数点の直前に要求 されているある数字は別として、小数点に伴うゼロは無いに違いありま せん。;小数点の後のある要求された数字の向こうには、たくさんの数 字があるに違いありません。しかし、所詮たくさんで他の数字を全ての 他のIEEE754の数値からユニークに区別する必要があります。

ブーリアン(boolean)のfalse値は文字列のfalseに変換されます。ブー リアン(boolean)のtrue値は文字列のtrueに変換されます。

四つの基本的な型以外の型のobjectはその型に依存した方法で文字列に 変換されます。

concat( *objects )

UNTESTED

テストされていません。

starts_with( string, test )

UNTESTED

テストされていません。

contains( string, test )

UNTESTED

テストされていません。

substring_before( string, test )

UNTESTED

テストされていません。

substring_after( string, test )

UNTESTED

テストされていません。

substring( string, start, length=0 )

UNTESTED

テストされていません。

string_length( string )

UNTESTED

テストされていません。

normalize_space( string=nil )

UNTESTED

テストされていません。

translate( string, tr1, tr2 )

UNTESTED

テストされていません。

boolean( object=nil )

UNTESTED

テストされていません。

not( object )

UNTESTED

テストされていません。

true( )

UNTESTED

テストされていません。

false( )

UNTESTED

テストされていません。

lang( language )

UNTESTED

テストされていません。

compare_language(lang1, lang2)
number( object=nil )

a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN

boolean true is converted to 1; boolean false is converted to 0

a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument

an object of a type other than the four basic types is converted to a number in a way that is dependent on that type

空白、Number、任意のマイナスの記号、任意の空白から成る文字列は、 文字列で表現された数学的な数値にするために、(IEEE754の最も近い浮 動小数点に丸めるルールによって)最も近いIEEE754の数字に変換されま す。;他の数はNaNに変換されます。

ブーリアン(boolean)のtrueは1に変換されます。;ブーリアン(boolean) のfalseは0に変換されます。

ノードセットは最初にまるでstring関数を呼んだように文字列に変換さ れ、それから引数がstringの時と同じ方法で変換されます。

四つの基本的な型以外の型のobjectは、その型に依存した方法で数字に 変換されます。

sum( nodes )
floor( nodes, number )
ceiling( nodes, number )
round( nodes, number )
method_missing( id )