るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. _builtin i
  5. matrix i

検索結果

<< 1 2 3 ... > >>

REXML::Attributes#each_attribute {|attribute| ... } -> () (15307.0)

各属性に対しブロックを呼び出します。

... REXML::Attribute オブジェクトで渡されます。

//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>
E
OS
a = doc.get_elements("/r...
...oot/a").first

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
e
nd
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

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

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

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

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>
E
OS
a = doc.get_elements("/root/a").first

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

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

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

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

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

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

XML プロセッサが prefix を置き換えてしまった場合...
...espace 名前空間(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>
E
OS
a = doc.get_ele...
...ments("/root/a").first

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") # =...

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

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

...としてブロックを呼び出します。

text を指定すると、テキストの内容が text であるもののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列...
...@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::Child#next_sibling=(other) (15207.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::Eleme...
...nt.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::DocType#external_id -> String | nil (15207.0)

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

...ている場合は "SYSTEM", "PUBLIC" の
いずれかの文字列を返します。

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

//emlist[][ruby]{
require
'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://ww...
...rict.dtd">
E
OS
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)>
]>
E
OS
doctype.name # => "books"
doctype.e...
...xternal_id # => nil
//}...

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

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

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

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

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

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

REXML::ParseException (15008.0)

XML のパースに失敗したときに生じる例外です。

...XML のパースに失敗したときに生じる例外です。

//emlist[][ruby]{
require
'rexml/document'
begin
REXML
::Document.new("<a>foo\n</b></a> ")
rescue REXML::ParseException => ex
e
x.position # => 16
e
x.line # => 2
e
x.context # => [16, 2, 2]
e
nd
//}...

REXML::ExternalEntity (15007.0)

DTD 内の宣言でパラメータ実体参照を使って宣言が されているものを表わすクラスです。

...<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;

//emlist[][ruby]{
require
'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE xhtml [
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"...
..."xhtml-symbol.ent">
%HTMLsymbol;
]>
E
OS

p doctype.children.find_all{|child| REXML::ExternalEntity === child }.map(&:to_s)
# => ["%HTMLsymbol;"]
//}...

REXML::Attributes#namespaces -> { String => String } (12407.0)

self の中で宣言されている名前空間の集合を返します。

...self の中で宣言されている名前空間の集合を返します。

返り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。

//emlist[][ruby]{
require
'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xm...
...lns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
E
OS
a = doc.get_elements("/root/a").first

p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>