48件ヒット
[1-48件を表示]
(0.020秒)
別のキーワード
ライブラリ
-
rexml
/ document (24)
キーワード
- Pretty (12)
- rdoc (12)
-
rexml
/ parsers / sax2parser (12)
検索結果
-
REXML
:: Formatters :: Default (18090.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...quire 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren/>
</children>
</root>
EOS
default_formatter = REXML::Formatters::Default.new
output = StringIO.new
default_formatter.write(doc, output)
output.string
# => "<root>\n<children>......\n <grandchildren/>\n</children>\n</root>\n"
output = StringIO.new
default_formatter.write(REXML::XPath.first(doc, "/root/children"), output)
output.string
# => "<children>\n <grandchildren/>\n</children>"
ie_hack_formatter = REXML::Formatters::Default.new(true)
output = StringIO.new
ie_hack_for......matter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren />\n</children>\n</root>\n"
//}... -
rexml
/ parsers / sax2parser (132.0) -
SAX2 と同等の API を持つストリーム式の XML パーサ。
...require 'rexml/parsers/sax2parser'
require 'rexml/sax2listener'
parser = REXML::Parsers::SAX2Parser.new(<<XML)
<root n="0">
<a n="1">111</a>
<b n="2">222</b>
<a n="3">333</a>
</root>
XML
elements = []
parser.listen(:start_element){|uri, localname, qname, attrs|
elements << [qname, attrs]
}......t">
%HTMLsymbol;
]>
<root xmlns="http://example.org/default"
xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar"><![CDATA[cdata is here]]>
<a foo:att='1' bar:att='2' att='<'>
<bar:b />
</a>
&& <!-- comment here--> &bar;
</root>
EOS
class Listener......art_document]
# >> [:xmldecl, "1.0", "UTF-8", nil]
# >> [:progress, 39]
# >> [:characters, "\n"]
# >> [:progress, 91]
# >> [:processing_instruction, "xml-stylesheet", " type=\"text/css\" href=\"style.css\""]
# >> [:progress, 91]
# >> [:characters, "\n"]
# >> [:progress, 144]
# >> [:doctype, "root",... -
rdoc (54.0)
-
RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。
...down、rd、rdoc、tomdoc のいずれかから選択できます。
: --root root
Root of the source tree documentation will be generated for. Set this
when building documentation outside the source directory. Default is
the current directory.
: --page-dir dir
Directory where guides,......FAQ or other pages not associated with
a class live. Set this when you don't store such files at your
project root. NOTE: Do not use the same file name in the page dir
and the root of your project
: --copy-files path
path で指定したファイルかディレクトリを出力先のデ......ます。=begin/=end を使う場合は、
以下のように =begin の行に 'rdoc' タグを付ける必要があります。
=begin rdoc
Documentation to
be processed by RDoc.
=end
パラグラフは左のインデントを揃えたテキストのかたまりで構成されます。そ... -
REXML
:: Formatters :: Pretty (42.0) -
XMLドキュメントを(文字列として)見た目良く出力するクラスです。
...ormatters::Default と
異なり見た目のためテキストの改行や空白を修正して出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/pretty'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren foo='bar'/>
</children>
</root>
EOS
pret......ty_formatter = REXML::Formatters::Pretty.new
output = StringIO.new
pretty_formatter.write(doc, output)
output.string
# => "<root>\n <children>\n <grandchildren foo='bar'/>\n </children>\n</root>"
# この出力結果は入力のXMLよりも空白が増えている
//}...