How do you declare a the “nbsp” entity in XML docu

2019-02-20 06:55发布

I am getting the following error

The entity "nbsp" was referenced, but not declared.

I tried to declare the nbsp (shown below) in my XML file. But this isn't working for me.

  <?xml version="1.0" encoding="UTF-8"?>
  <rss version="2.0"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  >
  <!DOCTYPE html [<!ENTITY nbsp "&#160;">

Am I missing something? Thanks!

1条回答
来,给爷笑一个
2楼-- · 2019-02-20 07:06

Put the DOCTYPE declaration before the root element start-tag. That is,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
   <!ENTITY nbsp "&#160;">
]>
<rss version="2.0"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
 >
 ...
</rss>
查看更多
登录 后发表回答