クラス
-
REXML
:: Attribute (1) -
REXML
:: Attributes (4) -
REXML
:: DocType (1) -
REXML
:: Element (7)
モジュール
-
REXML
:: Namespace (8)
キーワード
-
add
_ namespace (2) - attribute (1)
-
delete
_ namespace (1) - each (1)
-
each
_ attribute (1) -
get
_ attribute _ ns (1) -
has
_ name? (1) -
local
_ name (1) - name (1)
- name= (1)
- namespaces (3)
- prefix (1)
- prefix= (1)
- whitespace (1)
検索結果
先頭5件
-
REXML
:: Attribute # namespace(arg = nil) -> String | nil (72718.0) -
属性の名前空間の URI を返します。
...でなく、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... -
REXML
:: Element # namespace(prefix=nil) -> String (72682.0) -
self の文脈で prefix が指している名前空間の URI を返します。
...ます。
prefix で指示される名前空間の宣言が存在しない場合は 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(... -
REXML
:: Attributes # namespaces -> { String => String } (45907.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' at... -
REXML
:: DocType # namespaces -> nil (45907.0) -
nil を返します。
nil を返します。 -
REXML
:: Element # namespaces -> {String => String} (45907.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
:: Element # delete _ namespace(namespace = "xmlns") -> self (37267.0) -
名前空間を要素から削除します。
...はデフォルトの名前空間を削除します。
@param namespace 削除する名前空間の prefix
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
doc.root.delete_namespace
doc.to_s # => "<a xmlns:foo='bar'/>"
doc.root.delete_name... -
REXML
:: Element # add _ namespace(prefix , uri) -> self (36703.0) -
名前空間を要素に追加します。
...合はそれが上書きされます。
@param prefix 名前空間の prefix
@param uri 名前空間の uri
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.t... -
REXML
:: Element # add _ namespace(uri) (36703.0) -
名前空間を要素に追加します。
...合はそれが上書きされます。
@param prefix 名前空間の prefix
@param uri 名前空間の uri
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.t... -
REXML
:: Namespace # expanded _ name -> String (36373.0) -
REXML::Namespace#name= で設定された名前を返します。
...REXML::Namespace#name= で設定された名前を返します。
name= で指定した名前が prefix を含んでいれば
prefix を含む名前を返し、そうでなければ
prefix を含まない名前を返します。
@see REXML::Namespace#prefix... -
REXML
:: Namespace # fully _ expanded _ name -> String (36307.0) -
完全修飾名を返します。
完全修飾名を返します。 -
REXML
:: Namespace # has _ name?(other , ns = nil) -> bool (27343.0) -
self が other と ns で指定した名前を持っているならば真を返します。
...れます。
other が ":" を含んでいる(つまり prefix を含んでいる)場合は
REXML::Namespace#fully_expanded_name と other を比較します。
どちらでもない場合は other と REXML::Namespace#name を直接
比較します。
@param other 比較する名前(文字列)
@pa... -
REXML
:: Namespace # prefix -> String (27325.0) -
prefix (前置修飾子) を返します。
...prefix (前置修飾子) を返します。
@see REXML::Namespace#prefix=... -
REXML
:: Namespace # prefix=(value) (27325.0) -
prefix (前置修飾子) を設定します。
...prefix (前置修飾子) を設定します。
@param value prefix文字列
@see REXML::Namespace#prefix... -
REXML
:: Namespace # local _ name -> String (27307.0) -
prefix を含まない「ローカルな」名前を返します。
prefix を含まない「ローカルな」名前を返します。 -
REXML
:: Namespace # name -> String (27307.0) -
prefix を含まない「ローカルな」名前を返します。
prefix を含まない「ローカルな」名前を返します。 -
REXML
:: Namespace # name=(name) (27307.0) -
名前を設定します。
名前を設定します。
prefix を持つ名前も持たない名前も受け付けます。
@param name 名前(文字列) -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (18694.0) -
namespace と name で特定される属性を返します。
...ることができます。
@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' a... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (18646.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:att='1' bar:att='2' at... -
REXML
:: Attributes # each {|name , value| . . . } -> () (18325.0) -
各属性の名前と値に対しブロックを呼び出します。
...属性の名前と値に対しブロックを呼び出します。
名前には expanded_name(REXML::Namespace#exapnded_name)が
渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (18325.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 fo... -
REXML
:: Element # whitespace -> bool (18325.0) -
要素(self)内で空白が考慮されるならば真を返します。
...要素(self)内で空白が考慮されるならば真を返します。
これは、
* REXML::Element#context に :respect_whitespace も :compress_whitespace も
含まれない
* context の :respect_whitespace に self の要素名が含まれていて、
:compress_whitespace に se......のには :all が指定されている場合と、
配列に含まれている場合の両方があります。
のいずれかの場合に真を返します。
要素名として REXML::Namespace#expanded_name が使われるので、
名前空間の prefix は判定に影響します。...