781件ヒット
[1-100件を表示]
(0.175秒)
種類
- インスタンスメソッド (638)
- 特異メソッド (77)
- クラス (66)
クラス
-
REXML
:: Attribute (33) -
REXML
:: Attributes (143) -
REXML
:: CData (33) -
REXML
:: Child (22) -
REXML
:: DocType (66) -
REXML
:: Document (33) -
REXML
:: Element (187) -
REXML
:: Elements (77) -
REXML
:: Entity (11) -
REXML
:: Instruction (22) -
REXML
:: Text (44) -
REXML
:: XPath (33)
モジュール
キーワード
- << (11)
- Entity (11)
- ExternalEntity (11)
- Instruction (11)
- NotationDecl (11)
- ParseException (11)
- Transitive (11)
- [] (22)
- []= (22)
- add (11)
-
add
_ attribute (22) -
add
_ attributes (11) -
add
_ element (11) -
add
_ namespace (22) - attribute (11)
-
attribute
_ of (11) -
attributes
_ of (11) - content (11)
- delete (11)
-
delete
_ all (11) -
delete
_ attribute (11) - each (33)
-
each
_ attribute (11) -
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) - encoding (11)
- entitydecl (11)
-
external
_ id (11) - first (11)
-
get
_ attribute (11) -
get
_ attribute _ ns (11) -
get
_ text (11) - length (11)
- match (11)
- matches? (11)
- namespace (22)
- namespaces (22)
- new (22)
-
next
_ element (11) -
next
_ sibling= (11) - prefix (11)
- prefixes (22)
-
previous
_ sibling= (11) - public (11)
- size (22)
-
stand
_ alone? (11) - system (11)
- target (11)
- text (11)
-
to
_ a (22) -
to
_ s (22) -
to
_ string (11) - unnormalize (11)
- value (22)
- version (11)
- write (11)
- xpath (11)
検索結果
先頭5件
- REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () - REXML
:: Attributes # get _ attribute(name) -> Attribute | nil - REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil - REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () - REXML
:: Child # next _ sibling=(other)
-
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='<'/>
</root>
EOS
a = doc.get_elements("/r......oot/a").first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["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='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attributes.get_attribute("att") # => att='<'
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='<'/>
</root>
EOS
a = doc.get_ele......ments("/root/a").first
a.attributes.get_attribute_ns("", "att") # => att='<'
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">
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.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("& &foobar; <") # => "& &foobar; <"
REXML::Text.unnormalize("< >", nil, ["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
ex.position # => 16
ex.line # => 2
ex.context # => [16, 2, 2]
end
//}... -
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;
]>
EOS
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='<'/>
</root>
EOS
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
# => {}
//}...