るりまサーチ

最速Rubyリファレンスマニュアル検索!
144件ヒット [1-100件を表示] (0.143秒)

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. kernel p
  5. kernel $-p

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

REXML::Attribute#namespace(arg = nil) -> String | nil (24420.0)

属性の名前空間の URI を返します。

...@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example...
....com/ns")
e.add_attribute("ns:r", "rval")
p
e.attributes.get_attribute("r").prefix # => "ns"
p
e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}...

REXML::Element#namespace(prefix=nil) -> String (24326.0)

self の文脈で prefix が指している名前空間の URI を返します。

...self の文脈で prefix が指している名前空間の URI を返します。

p
refix を省略すると、デフォルトの名前空間の URI を返します。

p
refix で指示される名前空間の宣言が存在しない場合は nil を返します。

//emlist[][ruby]{
require 'rexml/...
...document'
doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/><y:d /></a>")
b = doc.elements['//b']
b.namespace # => "1"
b.namespace("y") # => "2"
b.namespace("z") # => nil
d = doc.elements['//y:d']
d.namespace # => "2"
//}...

Rake::TaskManager#in_namespace(name) {|name_space| ... } -> Array (15314.0)

与えられた名前の名前空間でブロックを評価します。

...します。

@param name 名前を指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app

namespace
:sample do
def hoge
p
uts "hoge"
end
end

task :test_rake_app do
task.application.in_namespace("sample") do
hoge # => "hoge"
end
end
//...

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

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

... prefix をキーとし、URI を値とする
Hash を返します。

//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

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

REXML::Element#namespaces -> {String => String} (12301.0)

self の文脈で定義されている名前空間の情報を返します。

...義されている名前空間を、{ 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'].namespaces # => {"x"=>"1", "y"=>"2"}
//}...

絞り込み条件を変える

REXML::Namespace#expanded_name -> String (12223.0)

REXML::Namespace#name= で設定された名前を返します。

...REXML::Namespace#name= で設定された名前を返します。

name= で指定した名前が prefix を含んでいれば
p
refix を含む名前を返し、そうでなければ
p
refix を含まない名前を返します。

@see REXML::Namespace#prefix...

REXML::Namespace#fully_expanded_name -> String (12201.0)

完全修飾名を返します。

完全修飾名を返します。

REXML::Namespace#prefix -> String (9207.0)

prefix (前置修飾子) を返します。

...prefix (前置修飾子) を返します。

@see REXML::Namespace#prefix=...

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

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

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

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

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

XML プロセッサが prefix を置き換えてしまった場合...
...することができます。

@param namespace 名前空間(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...
...= doc.get_elements("/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"...
<< 1 2 > >>