るりまサーチ

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

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document to_s
  4. rexml/document clone
  5. rexml/document node_type

ライブラリ

キーワード

検索結果

REXML::XMLDecl (8049.0)

XML 宣言を表すクラス。

...#xml_decl を使います。

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

xml_decl = doc.xml_decl
xml_decl.version # => "1.0"
xml_decl.encoding # => "UTF-8"
xml_decl.standalone # => "yes"
xml_decl.wri...
...合の例。][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<e />
EOS

xml_decl = doc.xml_decl
xml_decl.version # => "1.0"
xml_decl.encoding # => "UTF-8"
xml_decl.standalone # => nil
xml_decl.writethis # => false
//}

//emlist[XML 宣言が encoding 属性を持たない場合の...
...例][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" ?>
<e />
EOS

xml_decl = doc.xml_decl
xml_decl.version # => "1.0"
xml_decl.encoding # => "UTF-8"
xml_decl.standalone # => nil
xml_decl.writethis # => true
//}...

REXML::Instruction (8013.0)

XML 処理命令(XML Processing Instruction, XML PI)を表すクラス。

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