るりまサーチ

最速Rubyリファレンスマニュアル検索!
238件ヒット [1-100件を表示] (0.176秒)
トップページ > クエリ:E[x] > クエリ:Document[x] > クエリ:prefix[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. open3 capture2e
  4. matrix det_e
  5. matrix rank_e

検索結果

<< 1 2 3 > >>

REXML::Attribute#prefix -> String (24255.0)

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

...

//emlist[][ruby]{
require 'rexml/document'
e
= REXML::Element.new( "elns:myelement" )
e
.add_attribute( "nsa:a", "aval" )
e
.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "elns"
a = REXML::Attribute.new( "x",...
..."y" )
p a.prefix # -> ""
//}...

REXML::Element#prefixes -> [String] (12234.0)

self の文脈で定義されている prefix を文字列の配列を返します。

...self の文脈で定義されている prefix を文字列の配列を返します。

対象の要素とその外側の要素で定義されている 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'].prefixes # => ["x", "y"]
//}...

REXML::Attributes#prefixes -> [String] (12228.0)

self の中で宣言されている prefix の集合を 文字列の配列で返します。

...self の中で宣言されている prefix の集合を
文字列の配列で返します。

self が属する要素より上位の要素で定義されているものは含みません。

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

p doc.root.attributes.prefixes # => ["foo", "bar"]
p a.attributes.prefixes # => []
//}...

Psych::Handler#start_document(version, tag_directives, implicit) -> () (12219.0)

YAML ドキュメントの始まりで呼び出されます。

...

version には YAML ドキュメントに宣言されているバージョンが
[major, minor] という配列で渡されます。宣言がない場合は空の配列が渡されます。

tag_directives には tag directive の配列が渡されます。
それぞれの tag は [prefix, suff...
...override してください。


@param version バージョン
@param tag_directives tag directive の配列
@param implicit ドキュメントが implicit に始まっているかどうか

=== 例

以下の YAML に対しては
%YAML 1.1
%TAG ! tag:tenderlovemaking.com,2009:
--- !squee
st...
...art_document に渡される引数は以下の通りです
version # => [1, 1]
tag_directives # => tenderlovemaking.com,2009:"
implicit # => false

以下の YAML に対しては
- x
- y
start_document に渡される引数は以下の通りです。
version # =>...

Psych::Nodes::Document.new(version=[], tag_directives=[], implicit=false) -> Psych::Nodes::Document (9241.0)

Document オブジェクトを生成します。

...
Document
オブジェクトを生成します。

version にはドキュメントのバージョンを指定します。
[major, minor] という配列で指定します。

tag_directives には tag directive の配列を指定します。
それぞれの tag は [prefix, suffix] という文字...
...します。

@param version YAML ドキュメントのバージョン
@param tag_directives tag directive の配列
@param implicit ドキュメントが implicit に始まっているかどうか

=== 例
以下の例では、YAML 1.1 のドキュメントで、
tag directive を1つ持ち、 imp...
...licit にドキュメントが開始
している Document オブジェクトを生成しています。

Psych::Nodes::Document.new(
[1,1],
tenderlovemaking.com,2009:",
true)

@see Psych::Handler#start_document...

絞り込み条件を変える

REXML::Attributes#namespaces -> { String => String } (9218.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
# => {}
//}...

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

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

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

対象の要素とその外側の要素で定義されている名前空間を、{ 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::Parsers::SAX2Parser#listen(ary, listener) -> () (6266.0)

コールバックをパーサに登録します。

...ブロックを指定した場合はそのブロックがコールバックされます。
ブロックを指定しない場合は REXML::SAX2Listener を include した
クラスのオブジェクトを指定します。

sym は以下のシンボルが指定でき、どの場合にコールバ...
...REXML::SAX2Listener の対応するメソッドで詳しく説明されていますので
そちらを参照してください。

* :start_document
(XML文書開始, REXML::SAX2Listener#start_document)
* :end_document
(XML文書終了, REXML::SAX2Listener#end_document)
* :start_elemen...
...REXML::SAX2Listener#start_element)
* :end_element
(要素終了, REXML::SAX2Listener#end_element)
* :start_prefix_mapping
(名前空間接頭辞導入, REXML::SAX2Listener#start_prefix_mapping)
* :end_prefix_mapping
(名前空間接頭辞適用終了, REXML::SAX2Listener#end_prefix...

REXML::Parsers::SAX2Parser#listen(listener) -> () (6266.0)

コールバックをパーサに登録します。

...ブロックを指定した場合はそのブロックがコールバックされます。
ブロックを指定しない場合は REXML::SAX2Listener を include した
クラスのオブジェクトを指定します。

sym は以下のシンボルが指定でき、どの場合にコールバ...
...REXML::SAX2Listener の対応するメソッドで詳しく説明されていますので
そちらを参照してください。

* :start_document
(XML文書開始, REXML::SAX2Listener#start_document)
* :end_document
(XML文書終了, REXML::SAX2Listener#end_document)
* :start_elemen...
...REXML::SAX2Listener#start_element)
* :end_element
(要素終了, REXML::SAX2Listener#end_element)
* :start_prefix_mapping
(名前空間接頭辞導入, REXML::SAX2Listener#start_prefix_mapping)
* :end_prefix_mapping
(名前空間接頭辞適用終了, REXML::SAX2Listener#end_prefix...

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

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

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

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("y") # => "2"
b.namespace("z") # => nil
d = doc.elements['//y:d']
d.namespace # => "2"
//}...

絞り込み条件を変える

<< 1 2 3 > >>