Module

REXML::Functions

Inheritance

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()"

Methods

Class

Visibility Signature
public boolean ( object=nil )
public ceiling ( number )
public compare_language (lang1, lang2)
public concat ( *objects )
public contains ( string, test )
public context= (value)
public count ( node_set )
public false ( )
public floor ( number )
public get_namespace ( node_set = nil ) {|@@context[:node] if defined? @@context[:node].namespace| ...}
public id ( object )
public lang ( language )
public last ( )
public local_name ( node_set=nil )
public method_missing ( id )
public name ( node_set=nil )
public namespace_context ()
public namespace_context= (x)
public namespace_uri ( node_set=nil )
public normalize_space ( string=nil )
public not ( object )
public number ( object=nil )
public position ( )
public processing_instruction ( node )
public round ( number )
public starts_with ( string, test )
public string ( object=nil )
public string_length ( string )
public string_value ( o )
public substring ( string, start, length=nil )
public substring_after ( string, test )
public substring_before ( string, test )
public sum ( nodes )
public text ( )
public translate ( string, tr1, tr2 )
public true ( )
public variables ()
public variables= (x)

Class Method Detail

boolean( object=nil )

UNTESTED

ceiling( number )

compare_language(lang1, lang2)

concat( *objects )

UNTESTED

contains( string, test )

Fixed by Mike Stok

context=(value)

count( node_set )

false( )

UNTESTED

floor( number )

get_namespace( node_set = nil ) {|@@context[:node] if defined? @@context[:node].namespace| ...}

Helper method.

id( object )

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

lang( language )

UNTESTED

last( )

local_name( node_set=nil )

UNTESTED

method_missing( id )

name( node_set=nil )

namespace_context()

namespace_context=(x)

namespace_uri( node_set=nil )

normalize_space( string=nil )

UNTESTED

not( object )

UNTESTED

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

position( )

processing_instruction( node )

round( number )

starts_with( string, test )

Fixed by Mike Stok

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.

string_length( string )

UNTESTED

string_value( o )

substring( string, start, length=nil )

Take equal portions of Mike Stok and Sean Russell; mix vigorously, and pour into a tall, chilled glass. Serves 10,000.

substring_after( string, test )

Kouhei fixed this too

substring_before( string, test )

Kouhei fixed this

sum( nodes )

text( )

translate( string, tr1, tr2 )

This is entirely Mike Stok‘s beast

true( )

UNTESTED

variables()

variables=(x)