Can sitemap.xml precessors cope with <!ENTITY name "my text">?
Can sitemap.xml precessors cope with this ?
<?xml version="1.0" encoding="UTF-8"?>
<!ENTITY port ":8080">
<!ENTITY host"http://example.com&port;">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>&a开发者_开发技巧mp;host;/path/</loc>
<!-- ...
I assume so. It will most likely just ignore it though. If there is no Sitemaps DTD, I think it has to ignore it unless it expects it.
From Wikipedia:
In the markup languages SGML, HTML, XHTML and XML, a character entity reference is a reference to a particular kind of named entity that has been predefined or explicitly declared in a Document Type Definition (DTD). The "replacement text" of the entity consists of a single character from the Universal Character Set/Unicode. The purpose of a character entity reference is to provide a way to refer to a character that is not universally encodable.
In short, no. Not unless the preprocessor is very forgiving.
精彩评论