XMLにおいて アンパサンド(&)はエスケープが必要
基本的すぎる話かもしれないが... sitemap_generator で XML を生成していて気付いた。
サイトマップ ファイルは UTF-8 エンコードで作成する必要があります (ファイルを保存すると、通常は UTF-8 エンコードで保存されます)。 他の XML ファイルと同じように、URL などのデータ値では、次の文字にエンティティのエスケープ コードを使用する必要があります。
文字 | エスケープコード | |
---|---|---|
アンパサンド | & | & |
一重引用符 | ' | ' |
二重引用符 | " | " |
不等記号 (より大) | > | > |
不等記号 (より小) | < | < |
http://www.sitemaps.org/ja/protocol.html#escaping
The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings " & " and " < " respectively.
と書かれている。
知らなかったー