るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

<< 1 2 3 ... > >>

REXML::Attribute#to_string -> String (15409.0)

"name='value'" という形式の文字列を返します。

..."name='value'" という形式の文字列を返します。

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

REXML::Comment#string -> String (12404.0)

コメント文字列を返します。

コメント文字列を返します。

REXML::Comment#string=(value) (12202.0)

コメント文字列を設定します。

コメント文字列を設定します。

@param value 設定する文字列

REXML::DocType#attribute_of(element, attribute) -> String | nil (6402.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)>
<!...
...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::Comment#to_s -> String (6204.0)

コメント文字列を返します。

コメント文字列を返します。

絞り込み条件を変える

REXML::Formatters::Transitive (6019.0)

XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。

...quire 'rexml/document'
require 'rexml/formatters/transitive'
doc = REXML::Document.new <<EOS
<root><children>
<grandchildren foo='bar' />
</children></root>
EOS

tr
ansitive_formatter = REXML::Formatters::Transitive.new
output = StringIO.new
tr
ansitive_formatter.write(doc, output)
output.string
# =>...
...n\n ></root\n>\n"
print output.string
# >> <root
# >> ><children
# >> >
# >> <grandchildren foo='bar'
# >> />
# >> </children
# >> ></root
# >> >

output = StringIO.new
tr
ansitive_formatter.write(REXML::XPath.first(doc, "/root/children"), output)
output.string
# => "<children\n>\n<grandchil...

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

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>
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::Attribute#namespace(arg = nil) -> String | nil (3202.0)

属性の名前空間の 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.c...

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

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

...mlist[][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...

REXML::Attribute#to_s -> String (3202.0)

正規化された属性値を返します。

正規化された属性値を返します。

属性値の正規化については XML の仕様を参考にしてください。

絞り込み条件を変える

<< 1 2 3 ... > >>