Language detail: Other(XML)
Coverage: 1.52%
|
number of '+' ratings |
contribution for coverage |
Unsolved challenges
- 文字列で+を表示する (Nested Flatten)
- 年賀はがきの当せん番号 (Nested Flatten)
- 箱詰めパズルの判定 (Nested Flatten)
- 関数やメソッドのソースの平均行数 (Nested Flatten)
- コレクションの実装 (Nested Flatten)
codes
複数行のコメントアウト
(Nested
Flatten)
まだ、XML系が1つも出ていないので、代表としてXHTMLを投稿します。ところで、現在どう書く?の言語の選択肢にXAMLとXSLTがあるんですけど、彼らもXMLレベルのコメントの構文は同じなんですよね。そんなことを気にしたら投稿できないですけど。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<title>XHTML+XMLコメントの例</title>
</head>
<body>
<p>本文。<!--ここはコメント--></p>
<!--
<p>あーあー、見えない。</p>
-->
</body>
</html>
|
Hello, world! PDF版
(Nested
Flatten)
XSL-FO です。
Apache FOP 等で
fop -c fop.xconf hello.fo hello.pdf
Apache FOP 等で
fop -c fop.xconf hello.fo hello.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <?xml version="1.0" encoding="UTF-8" ?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
page-height="210mm" page-width="297mm"
margin-top="20mm" margin-bottom="20mm"
margin-left="20mm" margin-right="20mm"
master-name="Pagemaster-1" >
<fo:region-body
margin-top="5mm" margin-bottom="5mm"
margin-left="5mm" margin-right="5mm" />
<fo:region-before extent="10mm" />
<fo:region-after extent="10mm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Pagemaster-1" >
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="96pt" text-align="center">
Hello, world!
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
|



egtra
#9506()
[
Other(XML)
]
Rating0/0=0.00
HTMLで書いて言語にOtherを選ぶよりは、XHTMLで書いてOther(XML)とするほうを選びました。lang属性の使い方に自信がありませんがbody要素にまで使ってみました。
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <title>どう書く?org お題: Hello, world!</title> </head> <body xml:lang="en" lang="en"> <p>Hello, World!</p> </body> </html>Rating0/0=0.00-0+
[ reply ]