818件ヒット
[101-200件を表示]
(0.096秒)
別のキーワード
ライブラリ
- ビルトイン (160)
- matrix (128)
-
rexml
/ document (516) - set (14)
クラス
- Array (60)
- Matrix (64)
- Module (12)
- Proc (6)
-
REXML
:: Attribute (36) -
REXML
:: Attributes (12) -
REXML
:: Child (24) -
REXML
:: DocType (48) -
REXML
:: Element (276) -
REXML
:: Elements (108) -
REXML
:: Text (12) - Range (4)
- Set (20)
- Vector (64)
モジュール
- Enumerable (72)
キーワード
- << (12)
- [] (24)
- []= (12)
- add (12)
-
add
_ attribute (24) -
add
_ attributes (12) -
add
_ element (12) -
add
_ namespace (24) - attribute (12)
-
attribute
_ of (12) -
attributes
_ of (12) - collect! (28)
- component (12)
- delete (24)
-
delete
_ all (12) -
delete
_ attribute (12) -
delete
_ element (12) -
delete
_ namespace (12) -
drop
_ while (48) - each (12)
-
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) -
elements
_ to _ f (12) -
elements
_ to _ i (12) -
elements
_ to _ r (12) -
external
_ id (12) -
get
_ text (12) -
has
_ elements? (12) - inspect (12)
- map! (28)
- namespace (24)
- namespaces (12)
-
next
_ element (12) -
next
_ sibling= (12) - prefix (12)
- prefixes (12)
-
previous
_ sibling= (12) -
reverse
_ each (28) - root (12)
-
root
_ node (12) -
ruby2
_ keywords (18) - size (12)
-
take
_ while (48) - text (12)
- text= (12)
-
to
_ a (12) -
to
_ s (8) -
to
_ string (12) - transpose (12)
- value= (12)
- write (12)
- xpath (12)
検索結果
先頭5件
-
REXML
:: Element # next _ element -> Element | nil (12221.0) -
次の兄弟要素を返します。
...次の兄弟要素を返します。
次の要素が存在しない場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/>text<c/></a>'
doc.root.elements['b'].next_element # => <c/>
doc.root.elements['c'].next_element # => nil
//}... -
REXML
:: Element # has _ elements? -> bool (12107.0) -
self が一つでも子要素を持つならば true を返します。
...true を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b/><c>Text</c></a>")
doc.root.has_elements? # => true
doc.elements["/a/b"].has_elements? # => false
# /a/c はテキストノードしか持たないので false である
doc.elements......["/a/c"].has_elements? # => false
//}... -
REXML
:: Element # prefixes -> [String] (12107.0) -
self の文脈で定義されている prefix を文字列の配列を返します。
...いる prefix を文字列の配列を返します。
対象の要素とその外側の要素で定義されている prefix を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].prefixes #... -
REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil (9213.0) -
要素から key という属性名の属性を削除します。
...。
@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.delete_attribute("x")......; e # => <E y:x='bar'/>
//}... -
REXML
:: Element # root -> REXML :: Element (9208.0) -
self が属する文書のルート要素を返します。
...t[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS
children = doc.get_elements("/root/children").first
children.name # => "children"
children.root.name # => "root"
grandchildren = doc.get_elements("/root/children/grandc......hildren").first
grandchildren.name # => "grandchildren"
grandchildren.root.name # => "root"
//}... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (9207.0) -
name で指定される属性を返します。
...name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という......。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS......a = doc.get_elements("/root/a").first
a.attribute("att") # => att='<'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a.attribute("baz") # => nil
//}... -
Vector
# elements _ to _ f -> Vector (9207.0) -
ベクトルの各成分をFloatに変換したベクトルを返します。
...ベクトルの各成分をFloatに変換したベクトルを返します。
このメソッドは deprecated です。 map(&:to_f) を使ってください。
//emlist[例][ruby]{
require 'matrix'
v = Vector.elements([2, 3, 5, 7, 9])
p v.elements_to_f
# => Vector[2.0, 3.0, 5.0, 7.0, 9.0]
//}... -
Vector
# elements _ to _ i -> Vector (9207.0) -
ベクトルの各成分をIntegerに変換したベクトルを返します。
...ベクトルの各成分をIntegerに変換したベクトルを返します。
このメソッドは deprecated です。 map(&:to_i) を使ってください。
//emlist[例][ruby]{
require 'matrix'
v = Vector.elements([2.5, 3.0, 5.01, 7])
p v.elements_to_i
# => Vector[2, 3, 5, 7]
//}... -
REXML
:: Child # previous _ sibling=(other) (9131.0) -
other を self の前の隣接ノードとします。
...her を self の前の隣接ノードとします。
つまり、親ノードが持つ子ノード列の self の前に
other を挿入します。
@param other 挿入するノード
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.......new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibling = d
p a.to_s # => "<a><d/><b/><c/></a>"
//}... -
REXML
:: Element # add _ attributes(attrs) -> () (9119.0) -
要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...attrs には Hash もしくは Array を指定できます。
Hash の場合は、
{ "name1" => "value1", "name2" => "value2", ... }
という形で、配列の場合は
[ ["name1", "value1"], ["name2", "value2"], ... }
という形で追加/更新する属性を指定します。
@param attrs......する属性の属性名と属性値の対の集合(Array or Hash)
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("e")
e.add_attributes({"a" => "b", "c" => "d"})
e # => <e a='b' c='d'/>
e = REXML::Element.new("e")
e.add_attributes([["a", "b"], ["c", "d"]])
e # => <e a='b' c='d'/>...