翻译

实体”“被引用,但没有声明

问题

使用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里面含有&nbsp会出现The entity "nbsp" was referenced, but not declared.这个异常,解决的办法是把&nbsp替换成&#160即可!

The entity "nbsp" was referenced, but not declared的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. An entity object cannot be referenced by multiple instances of IEntityChangeTracker 的解决方案

    使用EF对建立了关系的表新增记录时出现: An entity object cannot be referenced by multiple instances of IEntityChangeTra ...

  5. 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" ...

  6. EntityFramework 异常 -- An entity object cannot be referenced by multiple instances of IEntityChangeTracker

    问题      在调用 DbSet 的 Attach()  方法时(与将 Entity 设置为 EntityState.Unchanged 状态等价)报告以下错误:      An entity ob ...

  7. EF异常探究(An entity object cannot be referenced by multiple instances of IEntityChangeTracker.)

    今天在改造以前旧项目时出现了一项BUG,是由于以前不规范的EF写法所导致.异常信息如下: "An entity object cannot be referenced by multiple ...

  8. An entity object cannot be referenced by multiple instances of IEntityChangeTracker.

    如果你和我一样遇到了这个问题,那么你就要检查你要操作的Model对象查询,更新操作的数据库上下文也就是DBContext是否一致.如果不一致也就是说你用AContext去查如AContext.SET& ...

  9. 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 ...

随机推荐

  1. 针对Oracle的一系列操作

    一.有关于数据库导出dmp的语句. 1 将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中exp system/manager@TEST file=d ...

  2. 1016D.Vasya And The Matrix#矩阵存在

    题目出处:http://codeforces.com/contest/1016/problem/D #include<iostream> #define ll long long int ...

  3. leetcode腾讯精选练习之除自身以外数组的乘积(十)

    最长公共前缀 题目 给定长度为 n 的整数数组 nums,其中 n > 1,返回输出数组 output ,其中 output[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积. ...

  4. 蓝桥杯 乘积最大(区间dp、数据水的话long long,暴力就能过)

    Description 今年是国际数学联盟确定的“2000——世界数学年”,又恰逢我国著名数学家华罗庚先生诞辰90周年.在华罗庚先生的家乡江苏金坛,组织了一场别开生面的数学智力竞赛的活动,你的一个好朋 ...

  5. 注解ImportBeanDefinitionRegistrar ImportSelector

    ImportBeanDefinitionRegistrar动态注册bean https://blog.csdn.net/jiachunchun/article/details/94569246 Spr ...

  6. Android开发学习4

    学习内容: 1.RecyclerView 2.WebView

  7. 使用node 做静态文件服务器

    # 1. 使用server-static 包 使用node可以非常快速的方法把指定目录共享出去 前提条件:安装了node,附带有npm 要托管的文件目录为 /root/www # 先创建一个目录用来存 ...

  8. redis安装zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录

    问题: zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录 解决方案:执行命令:make MALLOC=libc make MALLOC=libc

  9. php通过身份证判断性别

    /** 已测试,百度很多写法不行的 * 1就是男性 2就是女性* 通过身份证获取性别类型* @param type $card* @return int*/function getCardSex($i ...

  10. swift中的category,扩展

    1.创建选择 :swift file 2.名称:UIBarButtonItem-Extension 3.category,便利构造函数 extension UIColor { /* 1.extensi ...