[Date Prev] [Date Index] [Date Next]
[Thread Prev] [Thread Index] [Thread Next]

[xyzzy:08815] XML1.0 でのコメント (Re: Re: 文字コードを正しく認識させる方法)



岩井です。

On Sun, 29 Jun 2003 20:36:36 +0900
Subject: [xyzzy:08812] Re: 文字コードを正しく認識させる方法
Message-Id: <20030629203637.kamail.aGlyby1hYmU=@xxxxxxxxxxxxxxxxxx>
ABE Hiroshi <hiro-abe@xxxxxxxxxxxxxxxxxx> wrote:

> # ところでXML宣言の前ってコメントOKですかね。

XML 1.0 Second Edition ではダメです。

http://www.w3.org/TR/REC-xml#sec-well-formed
| 2.1 Well-Formed XML Documents
| [Definition: A textual object is a well-formed XML document if:]
|   - a) Taken as a whole, it matches the production labeled document.

で、

document ::= prolog element Misc*
prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
Misc ::= Comment | PI | S
Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

# それぞれ
# http://www.w3.org/TR/REC-xml#NT-document
# http://www.w3.org/TR/REC-xml#NT-prolog
# http://www.w3.org/TR/REC-xml#NT-XMLDecl
# http://www.w3.org/TR/REC-xml#NT-Misc
# http://www.w3.org/TR/REC-xml#NT-Comment

です。

-- 
いわい

Index Home