Returns the string value of this text node. This string is always escaped, meaning that it is a valid XML
text node string, and all entities that can be escaped, have been inserted. This method respects the entity filter set in the constructor.
# Assume that the entity "s" is defined to be "sean", and that the # entity "r" is defined to be "russell" t = Text.new( "< & sean russell", false, nil, false, ['s'] ) t.to_s #-> "< & &s; russell" t = Text.new( "< & &s; russell", false, nil, false ) t.to_s #-> "< & &s; russell" u = Text.new( "sean russell", false, nil, true ) u.to_s #-> "sean russell"
Escapes all possible entities
Unescapes all possible entities
Finds and returns the first node that matches the supplied xpath.
The context element
The xpath to search for. If not supplied or nil, returns the first node matching ‘*’.
If supplied, a Hash
which defines a namespace mapping.
If supplied, a Hash
which maps $variables in the query to values. This can be used to avoid XPath
injection attacks or to automatically handle escaping string values.
XPath.first( node ) XPath.first( doc, "//b"} ) XPath.first( node, "a/x:b", { "x"=>"http://doofus" } ) XPath.first( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"})
Performs a depth-first (document order) XPath
search, and returns the first match. This is the fastest, lightest way to return a single result.
FIXME: This method is incomplete!
Builds a nodeset of all of the preceding nodes of the supplied node, in reverse document order
includes every element in the document that precedes this node,
except for ancestors
Reads tuple
from the proxied TupleSpace
. See TupleSpace#read
.
Called by the TupleSpace
to check if the object is still alive.
Contains all discovered TupleSpaces except for the primary.
Contains all discovered TupleSpaces except for the primary.
Has this tuple expired? (true/false).
A tuple has expired when its expiry timer based on the sec
argument to initialize runs out.
Reset the expiry time according to sec_or_renewer
.
nil
it is set to expire in the far future.
true
it has expired.
Numeric
it will expire in that many seconds.
Otherwise the argument refers to some kind of renewer object which will reset its expiry time.
Reads tuple
, but does not remove it.