11件ヒット
[1-11件を表示]
(0.207秒)
ライブラリ
- rexml (1)
-
rexml
/ document (10)
キーワード
- Comment (1)
- Default (1)
- Entity (1)
- ExternalEntity (1)
- Instruction (1)
- NotationDecl (1)
- ParseException (1)
- Pretty (1)
- Transitive (1)
- TreeParser (1)
- XMLDecl (1)
検索結果
先頭5件
-
REXML
:: Formatters :: Default (24130.0) -
XMLドキュメントを(文字列として)出力するクラスです。
XMLドキュメントを(文字列として)出力するクラスです。
REXML::Formatters::Pretty と
異なりテキストの改行や空白を修正せずにそのまま出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren/>
</children>
</root>
EOS
default_formatter = REXML::Formatters::... -
REXML
:: XMLDecl (24112.0) -
XML 宣言を表すクラス。
XML 宣言を表すクラス。
文書から XML 宣言を取り出すには REXML::Document#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_de... -
REXML
:: Formatters :: Transitive (24094.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
XMLドキュメントをテキストの内容を変えずに
多少の整形を加えて出力するクラスです。
これが有用な場合はあまりないでしょう。
整形されていない XML を整形したいが、
テキストの空白は改行は変えたくない場合には役にたつかもしれません。
ただ、ほとんどの場合は奇妙な出力結果になるでしょう。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/transitive'
doc = REXML::Document.new <<EOS
<root><children>
<grandchildren foo='ba... -
REXML
:: Formatters :: Pretty (24076.0) -
XMLドキュメントを(文字列として)見た目良く出力するクラスです。
XMLドキュメントを(文字列として)見た目良く出力するクラスです。
REXML::Formatters::Default と
異なり見た目のためテキストの改行や空白を修正して出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/pretty'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren foo='bar'/>
</children>
</root>
EOS
pretty_formatter = REXM... -
REXML
:: Comment (24040.0) -
XML コメントを表すクラス。
XML コメントを表すクラス。
コメントとは <!-- と --> で挟まれたテキストです。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<!-- xx -->
<root>
<!-- yy -->
text
<!-- zz -->
</root>
EOS
doc[0].string # => " xx "
doc.root[1].string # => " yy "
doc.root[3].string # => " zz "
//} -
REXML
:: Entity (24040.0) -
XML における実体(エンティティ、entity)の宣言(declaration)を表わすクラス。
XML における実体(エンティティ、entity)の宣言(declaration)を表わすクラス。
DTD(REXML::DocType)内の実体宣言に対応するものです。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<!DOCTYPE document [
<!ENTITY f "foo bar baz">
<!ENTITY x SYSTEM "x.txt">
<!ENTITY y SYSTEM "y.png" NDATA PNG>
<!ENTITY % z "zzz">
<!EN... -
REXML
:: ExternalEntity (24040.0) -
DTD 内の宣言でパラメータ実体参照を使って宣言が されているものを表わすクラスです。
DTD 内の宣言でパラメータ実体参照を使って宣言が
されているものを表わすクラスです。
例えば、以下の DTD 宣言における %HTMLsymbol が
それにあたります。
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DO... -
REXML
:: Instruction (24040.0) -
XML 処理命令(XML Processing Instruction, XML PI)を表すクラス。
XML 処理命令(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-... -
REXML
:: NotationDecl (24040.0) -
DTD の記法宣言を表すクラスです。
DTD の記法宣言を表すクラスです。
//emlist[][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">... -
REXML
:: Parsers :: TreeParser (24022.0) -
内部用です。使わないでください。
内部用です。使わないでください。
XML 文書から DOMオブジェクトを組み立てるパーサです。
REXML::Document.new などから使われます。 -
REXML
:: ParseException (40.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
//}