るりまサーチ

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

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. _builtin nil
  5. object nil

検索結果

<< 1 2 3 ... > >>

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

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

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

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

XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使うことで属性を正し...
...uire '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_ns("", "att") # => att='&lt;'
a.attribut...
...es.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 (9309.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::XPath.match(element, path = nil, namespaces = {}, variables = {}) -> [Node] (9303.0)

element の path で指定した XPath 文字列にマッチするノードの配列を 返します。

...element の path で指定した XPath 文字列にマッチするノードの配列を
返します。

path に相対パスを指定した場合は element からの相対位置で
マッチするノードを探します。
絶対パスを指定した場合は element が属する文書のルー...
...ッチするノードを探します。
path を省略すると "*" を指定したことになります。

namespace で名前空間の対応付けを Hash で指定します。

variable で XPath 内の変数に対応する値を指定できます。
XPathインジェクション攻撃を避け...
...に用います。

@param element 要素(REXML::Element)
@param path XPath文字列
@param namespace 名前空間とURLの対応付け
@param variables 変数名とその値の対応付け

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:x='1'>
<a>
<b>b...

REXML::Element#attribute(name, namespace = nil) -> REXML::Attribute | nil (6416.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' att='...
...&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attribute("att") # => att='&lt;'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a.attribute("baz") # => nil
//}...

REXML::DocType#attribute_of(element, attribute) -> String | nil (6327.0)

DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。

...スト宣言で、 element という名前の要素の attribute という
名前の属性のデフォルト値を返します。

elementという名前の要素の属性値は宣言されていない、
elementという名前の要素にはattributeという名前の属性が宣言されていな...
... nil を返します。

@param element 要素名(文字列)
@param attribute 属性名(文字列)

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

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA...
...title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS

p doctype.attribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}...

絞り込み条件を変える

REXML::DocType#notation(name) -> REXML::NotationDecl | nil (6309.0)

DTD に含まれている記法宣言 (REXML::NotationDecl) で name という名前を持つものを返します。

...DTD に含まれている記法宣言 (REXML::NotationDecl) で
name という名前を持つものを返します。

name という名前を持つ記法宣言が存在しない場合は nil を返します。

@param name 検索する記法名...

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (6309.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#each_element_with_attribute(key, value = nil, max = 0, name = nil) {|element| ... } -> () (6304.0)

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

...ます。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。

max に 0 を指定すると、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 e }
# >> <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::Parent#delete_at(index) -> REXML::Child | nil (6210.0)

子ノード列上の index で指定された場所の要素を取り除きます。

...子ノード列上の index で指定された場所の要素を取り除きます。

取り除いだノードを返します。indexが範囲外である場合は何もせず
nil
を返します。...

REXML::Entity#ndata -> String | nil (6209.0)

解析対象外実体(unparsed entity)宣言である場合には その記法名(notation name)を返します。

...解析対象外実体(unparsed entity)宣言である場合には
その記法名(notation name)を返します。

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

絞り込み条件を変える

<< 1 2 3 ... > >>