るりまサーチ

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

別のキーワード

  1. argf.class lines
  2. argf.class each
  3. argf.class each_line
  4. argf.class gets
  5. argf.class to_a

キーワード

検索結果

REXML::ParseException (6009.0)

XML のパースに失敗したときに生じる例外です。

...XML のパースに失敗したときに生じる例外です。

//emlist[][ruby]{
require 'rexml/document'
begin
REXML
::Document.new("<a>foo\n</b></a> ")
rescue REXML::ParseException => ex
ex.position # => 16
ex.line # => 2
ex.context # => [16, 2, 2]
end
//}...

REXML::Instruction (6008.0)

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

...令(XML Processing Instruction, XML PI)を表すクラス。

XML 処理命令 とは XML 文書中の <? と ?> で挟まれた部分のことで、
アプリケーションへの指示を保持するために使われます。

XML 宣言(文書先頭の <?xml version=... ?>)は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...

REXML::NotationDecl (6008.0)

DTD の記法宣言を表すクラスです。

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

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!NOTATION type-image-svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!NOTATION type-image-gif PUBLIC "image/gif">
<!NOTATION foobar...
...SYSTEM "http://example.org/foobar.dtd">
]>
EOS

svg = doctype.notation("type-image-svg")
p svg.name # => "type-image-svg"
p svg.to_s # => "<!NOTATION type-image-svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"
p svg.public # => "-//W3C//DTD SVG 1.1/...
...f = doctype.notation("type-image-gif")
p gif.name # => "type-image-gif"
p gif.to_s # => "<!NOTATION type-image-gif PUBLIC \"image/gif\">"
p gif.public # => "image/gif"
p gif.system # => nil

foobar = doctype.notation("foobar")
p foobar.name # => "foobar"
p foobar.to_s # => "<!NOTATION foobar SYSTEM...