The entity "nbsp" was referenced, but not declared
翻译
实体”“被引用,但没有声明
问题
使用xhtmlrenderer将网页转成PDF时报The entity "nbsp" was referenced, but not declared.异常;而某些页面却是正常。这个问题是页面中包含了 导致的,而这个标记在页面中使用是很正常且频繁了。
原因
该问题是由于未定义HTML的DOCTYPE,致使SAX将内容按照xml默认定义进行解析,而xml中&开头表示可解析的实体,这个实体被DTD预先定义
解决
方法1.
加入正确的DOCTYPE,如:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
方法2.
html转换为XML格式的时候html里面含有 会出现The entity "nbsp" was referenced, but not declared.这个异常,解决的办法是把 替换成 即可!
The entity "nbsp" was referenced, but not declared的更多相关文章
- How to: Use the Entity Framework Model First in XAF 如何:在 XAF 中使用EF ModelFirst
This topic demonstrates how to use the Model First entity model and a DbContext entity container in ...
- Property referenced in indexed property path is neither an array nor a List nor a Map
记一次传参请求报错,没有解决 Invalid property 'distributeCars[0][ackStatus]' of bean class [com.api6.plate.prototy ...
- 13.1.17 CREATE TABLE Syntax
13.1.17 CREATE TABLE Syntax 13.1.17.1 CREATE TABLE ... LIKE Syntax 13.1.17.2 CREATE TABLE ... SELECT ...
- An entity object cannot be referenced by multiple instances of IEntityChangeTracker 的解决方案
使用EF对建立了关系的表新增记录时出现: An entity object cannot be referenced by multiple instances of IEntityChangeTra ...
- org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance:
详细错误堆栈信息: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" ...
- EntityFramework 异常 -- An entity object cannot be referenced by multiple instances of IEntityChangeTracker
问题 在调用 DbSet 的 Attach() 方法时(与将 Entity 设置为 EntityState.Unchanged 状态等价)报告以下错误: An entity ob ...
- EF异常探究(An entity object cannot be referenced by multiple instances of IEntityChangeTracker.)
今天在改造以前旧项目时出现了一项BUG,是由于以前不规范的EF写法所导致.异常信息如下: "An entity object cannot be referenced by multiple ...
- An entity object cannot be referenced by multiple instances of IEntityChangeTracker.
如果你和我一样遇到了这个问题,那么你就要检查你要操作的Model对象查询,更新操作的数据库上下文也就是DBContext是否一致.如果不一致也就是说你用AContext去查如AContext.SET& ...
- How to: Use the Entity Framework Data Model Located in an External Assembly 如何:使用位于外部程序集中的EF数据模型
If you have a non-XAF application, and want to develop an XAF application that utilizes the same dat ...
随机推荐
- Iptables用法规则及防火墙配置
[转载]http://www.cnblogs.com/yi-meng/p/3213925.html iptables规则 即防火墙规则,在内核看来,规则就是决定如何处理一个包的语句.如果一个包符合条 ...
- ACM-ICPC Asia Beijing Regional Contest 2018 Reproduction hihocoder1870~1879
ACM-ICPC Asia Beijing Regional Contest 2018 Reproduction hihocoder1870~1879 A 签到,dfs 或者 floyd 都行. #i ...
- Vue插件配置和 后台交互
Vue插件配置和 后台交互 一.全局配置静态文件(csss, js..) 1.1 全局配置css文件 创建css文件 在main.js配置css文件 // 配置全局css样式 // 方式一 impor ...
- POJ 3273 Monthly Expense二分查找[最小化最大值问题]
POJ 3273 Monthly Expense二分查找(最大值最小化问题) 题目:Monthly Expense Description Farmer John is an astounding a ...
- Python list 字符串 注册 登录
#list #列表 python中 数组.array等都用列表 list表示#创建一个liststu = ['xiaoming','xiaoli','xiaohuang','alex','lily', ...
- hdu2222 (AC自动机模板)
题:http://acm.hdu.edu.cn/showproblem.php?pid=2222 学习出:https://bestsort.cn/2019/04/28/402/ 主要是fail的建立. ...
- 前端之BOM与DOM-JQuery
一.前端基础之BOM和DOM: 1: JavaScript分为 ECMAScript,DOM,BOM BOM:指的是浏览器对象模型,它使JavaScript有能力与浏览器进行“对话” DOM:是指文档 ...
- [单调队列]XKC's basketball team
XKC's basketball team 题意:给定一个序列,从每一个数后面比它大至少 \(m\) 的数中求出与它之间最大的距离.如果没有则为 \(-1\). 题解:从后向前维护一个递增的队列,从后 ...
- OpenSSL EVP_Digest系列函数的一个样例
#include <stdio.h> #include <openssl/evp.h> main(int argc, char *argv[]) ...
- [Algo] 66. All Valid Permutations Of Parentheses I
Given N pairs of parentheses “()”, return a list with all the valid permutations. Assumptions N > ...