るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub!

検索結果

REXML::Document#encoding -> String (54664.0)

XML 宣言に含まれている XML 文書のエンコーディングを返します。

XML 宣言に含まれている XML 文書のエンコーディングを返します。

文書が XML 宣言を持たない場合はデフォルトの値
(REXML::XMLDecl.defaultで宣言されているもの)を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<e />
EOS
doc.encoding # => "UTF-8"
//}

REXML::Document#version -> String (54664.0)

XML 宣言に含まれている XML 文書のバージョンを返します。

XML 宣言に含まれている XML 文書のバージョンを返します。

文書が XML 宣言を持たない場合はデフォルトの値
(REXML::XMLDecl.defaultで宣言されているもの)を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<e />
EOS
doc.version # => "1.0"
//}

Encoding::UndefinedConversionError#destination_encoding_name -> String (36646.0)

エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

@see Encoding::UndefinedConversionError#destination_encoding

Encoding::UndefinedConversionError#error_char -> String (18343.0)

エラーを発生させた1文字を文字列で返します。

エラーを発生させた1文字を文字列で返します。

//emlist[例][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
begin
ec.convert("\u{a0}")
rescue Encoding::UndefinedConversionError
puts $!.error_char.dump #=> "\u{a0}"
end
//}

REXML::Document#stand_alone? -> String (343.0)

XML 宣言の standalone の値を文字列で返します。

XML 宣言の standalone の値を文字列で返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<e />
EOS
doc.stand_alone? # => "yes"
//}

絞り込み条件を変える

REXML::Instruction#content -> String | nil (343.0)

XML 処理命令の内容を返します。

XML 処理命令の内容を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<?foobar?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content...

REXML::Instruction#target -> String (343.0)

XML 処理命令のターゲットを返します。

XML 処理命令のターゲットを返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "t...