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

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



 こんばんは。あべです。


> 岩井です。
> 
>> # ところでXML宣言の前ってコメントOKですかね。
> 
> XML 1.0 Second Edition ではダメです。
> 

 なるほど。置けませんか。


 良い機会なので規格書を読んでみました。

 http://www.w3.org/TR/REC-xml#NT-EncodingDecl に拠ると
|  In the absence of information ..., it is an error ... for an entity which
| begins with neigher a Byte Order Mark nor an encoding declaration to use
| an encoding other than UTF-8.
らしいです。

 BOM がない時に XML 宣言に先行するコメント中のエンコーディングを知るのは
不可能なのでコメントが置けないのも当然といえば当然ですね。


 勉強になりました。ありがとうございます。


以上。

-----------------------------------
阿部 洋志 <hiro-abe@xxxxxxxxxxxxxxxxxx>
    -----------------------------------

Index Home