12件ヒット
[1-12件を表示]
(0.016秒)
別のキーワード
キーワード
- Comment (1)
- Default (1)
- DocType (1)
- Entity (1)
- ExternalEntity (1)
- Instruction (1)
- NotationDecl (1)
- Pretty (1)
- Transitive (1)
- TreeParser (1)
- XMLDecl (1)
検索結果
-
REXML
:: Document (54046.0) -
XMLの完全な文書(ドキュメント)を表すクラス。
XMLの完全な文書(ドキュメント)を表すクラス。
XML処理命令(Processing Instruction, PI)、
DTD(文書型定義、Document Type Definition)、
などを含んでいます。
ドキュメントは直下の子ノードをただ一つ持っています(rootと呼び、
REXML::Document#root でアクセスできます)。
2つ目の要素を(REXML::Element#add_elementなどで)追加しようとすると
例外(RuntimeError)が発生します。 -
REXML
:: XMLDecl (136.0) -
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......> "UTF-8"
xml_decl.standalone # => "yes"
xml_decl.writethis # => true
//}
//emlist[XML 宣言を省略した場合の例。][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.stand... -
REXML
:: Entity (64.0) -
XML における実体(エンティティ、entity)の宣言(declaration)を表わすクラス。
...宣言(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... -
REXML
:: DocType (58.0) -
XML の DTD(文書型定義、Document Type Definition)を表すクラスです。
XML の DTD(文書型定義、Document Type Definition)を表すクラスです。
rexml では DTD は積極的にはサポートされていません。
デフォルトの実体定義(gt, lt, amp, quot apos)の解決のため DTD は
ある程度はサポートされますが、スキーマの定義や検証をしたい場合は
XML schema や RELAX NG などを使ってください。
子ノード(REXML::Parent#children)として、
* REXML::ElementDecl
* REXML::ExternalEntity
* REXML::Entity
... -
REXML
:: Comment (46.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... -
REXML
:: ExternalEntity (46.0) -
DTD 内の宣言でパラメータ実体参照を使って宣言が されているものを表わすクラスです。
...<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE xhtml [
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"... -
REXML
:: Formatters :: Default (46.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...ML::Formatters::Pretty と
異なりテキストの改行や空白を修正せずにそのまま出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren/>
</children>
</root>
EOS
default_form... -
REXML
:: Formatters :: Pretty (46.0) -
XMLドキュメントを(文字列として)見た目良く出力するクラスです。
...Formatters::Default と
異なり見た目のためテキストの改行や空白を修正して出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/pretty'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren foo='bar'/>
</children>
</root>
EOS
pre... -
REXML
:: Formatters :: Transitive (46.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
...にたつかもしれません。
ただ、ほとんどの場合は奇妙な出力結果になるでしょう。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/transitive'
doc = REXML::Document.new <<EOS
<root><children>
<grandchildren foo='bar' />
</children></root>
EOS
tran... -
REXML
:: Instruction (46.0) -
XML 処理命令(XML Processing Instruction, XML PI)を表すクラス。
...頭の <?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[... -
REXML
:: NotationDecl (46.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-g... -
REXML
:: Parsers :: TreeParser (28.0) -
内部用です。使わないでください。
内部用です。使わないでください。
XML 文書から DOMオブジェクトを組み立てるパーサです。
REXML::Document.new などから使われます。