297件ヒット
[1-100件を表示]
(0.135秒)
種類
- インスタンスメソッド (275)
- 定数 (11)
- 特異メソッド (11)
ライブラリ
-
rexml
/ document (297)
キーワード
- UNDEFINED (11)
-
add
_ attribute (22) -
add
_ attributes (11) -
add
_ element (11) -
add
_ namespace (11) - attribute (11)
- attributes (11)
- context (11)
-
delete
_ attribute (11) - document (11)
-
each
_ element (11) -
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) -
get
_ text (11) -
has
_ attributes? (11) - instructions (11)
- namespace (11)
- namespaces (11)
- new (11)
-
next
_ element (11) - prefixes (11)
-
previous
_ element (11) - text (11)
- whitespace (11)
- write (11)
- xpath (11)
検索結果
先頭5件
- REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () - REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil - REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil - REXML
:: Element # attributes -> REXML :: Attributes - REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil
-
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (15401.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...テキストを子ノードとして
持つすべての子要素を引数としてブロックを呼び出します。
text を指定すると、テキストの内容が text であるもののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対......。
@param text テキストの中身(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
#......>> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}... -
REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil (9601.0) -
先頭のテキスト子ノードを返します。
...REXML::Text#value も参照してください。
path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#text
//emlis......t[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.get_text.value # => "some text "
//}... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (9401.0) -
name で指定される属性を返します。
...name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という......属性がない場合は nil を返します。
@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:a......tt='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
//}... -
REXML
:: Element # attributes -> REXML :: Attributes (9401.0) -
要素が保持している属性の集合を返します。
要素が保持している属性の集合を返します。 -
REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil (9401.0) -
要素から key という属性名の属性を削除します。
...ずに、nil を返します。
@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='ba......r'/>
e.delete_attribute("x"); e # => <E y:x='bar'/>
//}... -
REXML
:: Element # instructions -> [REXML :: Instraction] (9401.0) -
すべての instruction 子ノードの配列を返します。
...すべての instruction 子ノードの配列を返します。
返される配列は freeze されます。... -
REXML
:: Element # text(path = nil) -> String | nil (9401.0) -
先頭のテキスト子ノードの文字列を返します。
...REXML::Text#value も参照してください。
path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#get_text
//......emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.text # => "some text "
//}... -
REXML
:: Element # write(output = $ stdout , indent = -1 , transitive = false , ie _ hack = false) (9302.0) -
このメソッドは deprecated です。 REXML::Formatter を代わりに 使ってください。
...す。 REXML::Formatter を代わりに
使ってください。
output にその要素を文字列化したものを(子要素を含め)出力します。
@param output 出力先(IO のように << で書き込めるオブジェクト)
@param indent インデントのスペースの数(-1 だと......ない)
@param transitive XMLではインデントのスペースでDOMが変化してしまう場合がある。
これに真を渡すと、XMLのDOMに余計な要素が加わらないように
空白の出力を適当に抑制するようになる
@param ie_hack IEはバージョン... -
REXML
:: Element # context -> {Symbol => object} | nil (9301.0) -
要素の「コンテキスト」を Hash で返します。
...Hash で返します。
コンテキストとは text node (REXML::Text) での特別な文字、特に空白について
の取り扱いについての設定です。
以下の Symbol をハッシュのキーとして使います。
: :respect_whitespace
空白を考慮して欲しい要素の......。
デフォルト値は :all です。
REXML::Element#whitespace も参照してください。
: :compress_whitespace
空白を無視して欲しい要素の名前の集合を文字列の配列で指定します。
この指定は :respect_whitespace での指定を上書きします。......すべての要素で空白を無視して欲しい場合には
:all を指定します。
REXML::Element#whitespace も参照してください。
: :ignore_whitespace_nodes
空白のみからなるノードを無視して欲しい要素の名前の集合を
文字列の配列で指定し... -
REXML
:: Element # next _ element -> Element | nil (9301.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
//}...