| ENGLISH | JAPANESE |
個人的にはSmartDocという XMLドキュメントフォーマットをもっと書きやすくできないかと考えて、これを作るにいたりました。SXMLにすることでXMLに比べて以下のようなメリットがあると考えています。
Schemeの強力な言語パワーを使えます
S式なので 括弧の数さえ調整すれば Emacs が 自動的にインデントしてくれます
このページは Sxmlvncを使って作成しています。このページがサンプルとして最適でしょう。
sourceforgeのサマリページからダウンロードできます。
[0.1.0]
1. Apply patches and advice from Oleg Kiselyov(Thanks!)
1) local-rules feature applied.
2) And other re-factorings.
2. Sxmlcnv includes a useful style sheet for SmartDoc.
(SmartDoc:style-sheet)
3. Added feature : Supported error handling during
loading source file.
[0.0.4]
1. Apply patches and advice from Oleg Kiselyov(Thanks!)
1) Bug fix: Handling of SXML->XML's `port argument.
2) Bug fix: Better to use eqv? rather than eq? for
comparing characters.
3) Advice : Better to define some functions which has
no effect at the top level.
4) Advice : Better to use let* form rather than some
(set! args ...) modifications.
5) Advice : Better to use an input parsing library
to skip simple white-spaces
rather than using regular expressions.
[0.0.3]
1. Apply patches and advice from Oleg Kiselyov(Thanks!)
1) Patch : string->goodXML() instead of string->goodHTML()
2) Advice: He taught me the way to output a pretty-printed XML.
3) Advice: He taught me the way to output a well-formed XML.
4) Advice: He gave me pretty-printed XML sample code and
some advice.
2. Added feature: -p switch ... Enable pretty-print feature.
3. Added feature: -P switch ... Enable pretty-print + indent feature.
4. Added feature: Added `port argument to SXML->XML().
[0.0.2]
1. Added feature: Reading source from stdin
2. Added feature: Handling Japanese character encoding type of
the input.
3. Added feature: Adding suitable 'encoding=' attribute to
XML Declaration.
[0.0.1]
first release version
This is at least a partial credits of people that have
contributed to the Sxmlcnv project.
Formatted in a format that allows for easy grepping and
beautification by scripts. The fields are: name (N), email (E),
web-address (W), PGP key ID and fingerprint (P), description (D).
Thanks,
Kiyoka
----------
N: Kiyoka Nishiyama
E: kiyoka@netfort.gr.jp
D: Author of original sxmlcnv
W: http://www.netfort.gr.jp/~kiyoka/
N: Oleg Kiselyov
E: oleg@pobox.com
D: Contributer of Patches and advice for 0.0.3, 0.0.4., 0.1.0
入力を与えると内容を自動判別して変換します。
sxmlcnv version 0.x.x
Usage:
sxmlcnv [switches] < 'sxml-file/xml-file/scm-file' > outfile
or
sxmlcnv [switches] 'sxml-file/xml-file/scm-file' > outfile
Switches:
-h ... Display this help message.
-p ... Enable pretty-print feature.
-P ... Enable pretty-print + indent feature.
File: Action:
started with # line load and eval as scheme code
started with '(' load as s-exp and convert it to XML
started with '<?xml' load as XML and convert it to SXML
| 判別方法 | アクション |
|---|---|
| 1行目が#で始まっている | schemeコードどしてloadする(SXML->XML関数が使える) |
| '('で始まっている | SXMLのS式としてXMLに変換する |
| '<?xml'で始まっている | XMLとしてSXMLに変換する |
scheme codeとしてロードされる場合、以下の関数が使えます。
(SXML->XML local-rules SXML &optional port)
SxmlcnvはSmartDoc文書を簡潔に記述するためのスタイルシートを内蔵しています。
(define SmartDoc:abbrev-table
'( (Keyword-1 (S-exp-1))
(Keyword-2 (S-exp-2))
(Keyword-n (S-exp-n))))
,Keyword-1