812件ヒット
[201-300件を表示]
(0.197秒)
別のキーワード
ライブラリ
- ビルトイン (154)
- matrix (128)
-
rexml
/ document (516) - set (14)
クラス
- Array (60)
- Matrix (64)
- Module (12)
-
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 (12) - 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 # add _ attribute(key , value) -> () (15213.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...す方法と REXML::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェ......クト)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<e/>")
doc.root.add_attribute("a", "b"); doc.root # => <e a='b'/>
doc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
doc.root.add_attribute(REXML::Attribute.new("b", "d"))
doc.root # => <e a='b' x:a='c'... -
REXML
:: Element # prefixes -> [String] (15213.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 # root _ node -> REXML :: Document | REXML :: Node (15213.0) -
self が属する文書のルートノードを返します。
...書(REXML::Document) オブジェクトが
返されます。
その要素が属する REXML::Document オブジェクトが存在しない
場合は木構造上のルートノードが返されます。
//emlist[][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_node == doc # => true
grandchildren = doc.get_elements("/root/children/grandchildren").first
grandchildren.name # => "grandchildren"
grandchildren.root_node ==......doc # => true
//}... -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (12660.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...DTD 内の属性リスト宣言で、 element という名前の要素の attribute という
名前の属性のデフォルト値を返します。
elementという名前の要素の属性値は宣言されていない、
elementという名前の要素にはattributeという名前の属性が宣......@param element 要素名(文字列)
@param attribute 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title......CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS
p doctype.attribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}... -
REXML
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (12542.0) -
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。
...TD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている
属性の名前とデフォルト値を REXML::Attribute の配列で返します。
名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML::Attribute#name と
REXML::Att......ribute#value で表現されます。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title CDATA #REQUIRED
publisher......CDATA "foobar publisher">
]>
EOS
p doctype.attributes_of("book")
# => [author='', title='', publisher='foobar publisher']
p doctype.attributes_of("book")[0].name # => "author"
p doctype.attributes_of("book")[0].value # => ""
//}... -
REXML
:: Elements # delete(element) -> Element (12367.0) -
element で指定した子要素を取り除きます。
...element で指定した子要素を取り除きます。
element には、REXML::Element、整数、文字列が指定できます。
Element オブジェクトを指定した場合は、その子要素を取り除きます。
整数を指定した場合には element 番目の子要素を削除し......ます(1-originです)。
文字列を指定した場合は、削除する要素を XPath で指定します。
XPathが複数の要素を指している場合は、そのうち一つを削除します。
取り除かれた要素を返します。
XPath で指定した場合、子要素ではな......してください。
@param element 削除する要素(REXML::Element, 整数, 文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c/><c id="1"/></a>'
b = doc.root.elements[1]
doc.root.elements.delete b # => <b/>
doc.root.to_s... -
REXML
:: Attribute # to _ string -> String (12337.0) -
"name='value'" という形式の文字列を返します。
..."name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}... -
Array
# transpose -> Array (12319.0) -
自身を行列と見立てて、行列の転置(行と列の入れ換え)を行いま す。転置した配列を生成して返します。空の配列に対しては空の配列を生 成して返します。
...
TypeError が発生します。各要素のサイズが不揃いな配列に対して
は、例外 IndexError が発生します。
//emlist[例][ruby]{
p [[1,2],
[3,4],
[5,6]].transpose
# => [[1, 3, 5], [2, 4, 6]]
p [].transpose
# => []
p [1,2,3].transpose
# => -:1:in `transpose': cannot......convert Fixnum into Array (TypeError)
# from -:1
p [[1,2],
[3,4,5],
[6,7]].transpose
# => -:3:in `transpose': element size differ (3 should be 2) (IndexError)
//}... -
REXML
:: Elements # delete _ all(xpath) -> [REXML :: Element] (12314.0) -
xpath で指定した XPath 文字列にマッチする要素をすべて取り除きます。
...xpath で指定した XPath 文字列にマッチする要素をすべて取り除きます。
@param xpath 取り除く要素を指し示す XPath 文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a><c/><c/><c/><c/></a>')
doc.elements.delete_all("a/c") # => [<c/>, <......c/>, <c/>, <c/>]
doc.to_s # => "<a/>"
//}...