るりまサーチ

最速Rubyリファレンスマニュアル検索!
979件ヒット [1-100件を表示] (0.111秒)
トップページ > クエリ:i[x] > クエリ:l[x] > クエリ:NIL[x] > ライブラリ:rexml/document[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. kernel $-i

検索結果

<< 1 2 3 ... > >>

REXML::Text.unnormalize(string, doctype = nil, filter = nil, illegal = nil) -> String (12511.0)

string を非正規化(すべての entity をアンエスケープ)したものを 返します。

...string を非正規化(すべての entity をアンエスケープ)したものを
返します。

filter でアンエスケープしない実体の実体名を文字列配列で指定します。

@param string 非正規化する文字列
@param doctype DTD(REXML::DocType オブジェクト)
@par...
...m filter アンエスケープしない実体の実体名(文字列配列)
@param illegal 内部用。使わないでください。

//emlist[][ruby]{
require 'rexml/text'
REXML::Text.unnormalize("&amp; &foobar; &lt;") # => "& &foobar; <"
REXML::Text.unnormalize("&lt; &gt;", nil, ["lt"]) # => "&lt;...

REXML::Element#each_element_with_text(text = nil, max = 0, name = nil) {|element| ... } -> () (12510.0)

テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。

...mlist[][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_wit...
...h_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}...

REXML::Element#each_element_with_attribute(key, value = nil, max = 0, name = nil) {|element| ... } -> () (12504.0)

特定の属性を持つすべての子要素を引数としてブロックを呼び出します。

...を呼び出します。

key で指定した属性名の属性を持つ要素のみを対象とします。
value を指定すると、keyで指定した属性名を持つ属性の値がvalueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max...
...@param value 属性値(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e| p...
...>> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'...

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (12421.0)

namespace と name で特定される属性を返します。

...る属性を返します。

namespace で名前空間を、 name で prefix を含まない属性名を
指定します。

指定された属性が存在しない場合は nil を返します。

XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使...
...URI, 文字列)
@param name 属性名(文字列)

//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='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").fir...
...st

a.attributes.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...

REXML::Attributes#get_attribute(name) -> Attribute | nil (12409.0)

name という名前の属性を取得します。

...場合は nil を返します。

@param name 属性名(文字列)
@see REXML::Attributes#[]

//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='&lt;'/>
</...
...root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute("att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

絞り込み条件を変える

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (12409.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='bar'/>
e.delete_attribute("x"); e # => <E y:x='bar'/>
//}...

REXML::Element#previous_element -> Element | nil (12409.0)

前の兄弟要素を返します。

...前の兄弟要素を返します。

前の要素が存在しない場合は nil を返します。...

REXML::Parent#replace_child(to_replace, replacement) -> () (12408.0)

子ノード列上の to_replace を replacement に置き換えます。

...子ノード列上の to_replace を replacement に置き換えます。

to_replace の parent は nil に、
replacement の parent は selfに変更されます。

@param to_replace 置き換え元のノード
@param replacement 置き換え先のノード...

REXML::Text.normalize(input, doctype = nil, entity_filter = nil) -> String (12404.0)

input を正規化(すべての entity をエスケープ)したものを 返します。

...input を正規化(すべての entity をエスケープ)したものを
返します。

@param input 正規化する文字列
@param doctype DTD(REXML::DocType オブジェクト)
@param entity_filter 置換したい実体の名前の配列...

REXML::DocType#external_id -> String | nil (12315.0)

DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。

...PUBLIC" の
いずれかの文字列を返します。

それ以外の場合は nil を返します。

//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-...
...strict.dtd">
EOS
doctype.name # => "html"
doctype.external_id # => "PUBLIC"

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT books (book+)>
<!ELEMENT book (title,author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
EOS
doctype.name # => "books"
doctype...
....external_id # => nil
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>