HtmlCleaner CleanerProperties 参数配置(转自macken博客,链接:http://macken.iteye.com/blog/1579809)

HtmlCleaner CleanerProperties 参数配置


Parameter


Default


Explanation

advancedXmlEscape true If this parameter is set to true, ampersand sign (&) that proceeds valid XML character sequences (&XXX;) will not be escaped with &XXX;
transResCharsToNCR false If this parameter is set to true, reserved XML sequences (&, ", &apos;, <, >) are serialized to their Numeric Character Representations (#&38;, #&34;, #&39;, #&60;, #&62;). This parameter has effect only if advancedXmlEscape is set to true.
translateSpecialEntities true If true, special HTML entities (i.e. ?, ??, ?á) are replaced with unicode characters they represent (?, ??, ?á). This doesn‘t include &, <, >, ", &apos;.
transSpecialEntitiesToNCR false If this parameter is set to true, special HTML entities (i.e. |?) are serialized to their Numeric Character Representations (#&913;). This parameter has effect only if translateSpecialEntities is set to true.
recognizeUnicodeChars true If true, HTML characters represented by their codes in form &#XXXX; are replaced with real unicode characters (i.e. §? is replaced with §?)
useCdata true If true, HtmlCleaner will treat SCRIPT and STYLE tag contents as CDATA sections, or otherwise it will be regarded as ordinary text (special characters will be escaped).
omitUnknownTags false Tells whether to skip (ignore) unknown tags during cleanup.
treatUnknTagsAsContent false Tells whether to treat unknown tags as ordinary content, i.e. <something...> will be transformed to <something...>. This attribute is applicable only if omitUnknownTags is set to false.
omitDeprTags false Tells whether to skip (ignore) deprecated HTML tags during cleanup.
treatDeprTagsAsContent false Tells whether to treat deprecated tags as ordinary content, i.e. <font...> will be transformed to <font...>. This attribute is applicable only if omitDeprecatedTags is set to false.
omitComments false Tells whether to skip HTML comments.
omitXmlDeclaration false Tells whether or not to put XML declaration line at the beginning of the resulting XML.
omitDoctypeDeclaration true Tells whether to skip HTML declaration found in the source document. If HTML document being cleaned doesn‘t contain one it wouldn‘t be placed in the result anyway.
omitXmlnsAttributes false This flag is depricated since version 1.3 and namespacesAware should be used instead.
omitEnvelope false Tells whether to remove open and close tag being serialized. This parameter is introduced in HtmlCleaner 2.2 to replace omitHtmlEnvelope. If set to true, serialization skips open and close tags of the node, outputs only node‘s children.
useEmptyElementTags true Specifies how to serialize tags with empty body - if true, compact notation is used(<xxx/>), otherwise - <xxx></xxx>
allowMultiWordAttributes true Tells parser whether to allow attribute values consisting of multiple words or not. If true, attribute att="a b c" will stay like it is, and if false parser will split this into att="a" b="b" c="c" (this is default browsers‘ behaviour).
allowHtmlInsideAttributes false Tells parser whether to allow html tags inside attribute values. For example, when this flag is set att="here is <a href=‘xxxx‘>link</a>" will stay like it is, and if not, parser will end attribute value after "here is".
This flag makes sense only if allowMultiWordAttributes is set as well.

ignoreQuestAndExclam

true

Tells parser whether to completely ignore tags that have form <?TAGNAME....> or <!TAGNAME....>. This way some HTML/XML processing instructions may be omitted from the resulting xml.

namespacesAware

true

If true, namespace prefixes found during parsing will be preserved and all neccessery xml namespace declarations will be added in the root element. If false, all namespace prefixes and all xmlns namespace declarations will be stripped.

hyphenReplacement

=

XML doesn‘t allow double hyphen sequence (--) inside comments. This parameter tells which replacement to use for it when double hyphen is encountered during parsing.

pruneTags

empty string

Comma-separated list of tags that will be complitely removed (with all nested elements) from XML tree after parsing. For exampe if pruneTags is "script,style", resulting XML will not contain scripts and styles.

booleanAtts

self

Tells cleaner what value to give to boolean attributes, like checked, selected and similar. Allowed values are self - value of attribute is the same as attribute name (checked = "checked"), empty - attribute value is empty string (checked = "") and true - value of attribute is "true" (checked = "true").

nodeByXpath

XPath expression used to select first node that is going to be serialized instead of whole HTML document. For example if this parameter us set to //table[1] only first table in document will be serialized.

时间: 2024-08-29 02:41:08

HtmlCleaner CleanerProperties 参数配置(转自macken博客,链接:http://macken.iteye.com/blog/1579809)的相关文章

mweb配置发布文章到博客园

这是一篇mweb自动发布的测试文章 转载一篇mweb配置发布文章到博客园的文章 http://www.cnblogs.com/scut-linmaojiang/p/mweb-test.html

SVN服务器搭建--Subversio与TortoiseSVN的配置安装 - 新新 - 博客频道 - CSDN.NET (2)

1.  Subversio和TortoiseSVN 简介 Subversio简介: Subversion是一个自由,开源的版本控制系统,可以随意地免费下载.修改.以及重新发布. 是一个通用系统,可以管理任何类型的文件. 服务器运行方式:独立服务器和借助apache. 存储版本数据方式:一种是在 Berkeley DB 数据库中存放数据.另一种是使用普通文件,采用自定义的格式来储存,称为 FSFS. Tortoisesvn简介: TortoiseSVN 是 Subversion 版本控制系统的一个

关于Java一些好的博客链接:

关于Java一些好的博客链接(总结):    1.在web-inf中创建lib和classes,并绑定路径:    如何创建Web项目(http://www.cnblogs.com/yangyquin/p/5285272.html)        2.引用JSTL时,首先下载jakarta-taglibs-standard-1.1.2   http://blog.csdn.net/qq_31960191/article/details/52118616   http://blog.csdn.ne

文顶顶iOS开发博客链接整理及部分项目源代码下载

文顶顶iOS开发博客链接整理及部分项目源代码下载 网上的iOS开发的教程很多,但是像cnblogs博主文顶顶的博客这样内容图文并茂,代码齐全,示例经典,原理也有阐述,覆盖面宽广,自成系统的系列教程却很难找.如果你是初学者,在学习了斯坦福iOS7公开课和跟着文顶顶的博客做项目之后,最快只需要2个月时间,就基本可以独立完成iOS App的开发工作.有经验的开发者也可以在该博客中寻找代码片段进行学习借鉴,必有所收获. 在此也向@文顶顶 表示严重感谢! 由于文顶顶博客博文繁多,每次找文章需要频繁的翻页,

团队Alpha博客链接目录

团队Alpha博客链接目录 人月神教-α阶段冲刺报告(1/12) 人月神教-α阶段冲刺报告(2/12) 人月神教-α阶段冲刺报告(3/12) 人月神教-α阶段冲刺报告(4/12) 人月神教-α阶段冲刺报告(5/12) 人月神教-α阶段冲刺报告(6/12) 人月神教-α阶段冲刺报告(7/12) 人月神教-α阶段冲刺报告(8/12) 人月神教-α阶段冲刺报告(9/12) 人月神教-α阶段冲刺报告(10/12) 人月神教-α阶段冲刺报告(11/12) 人月神教-α阶段冲刺报告(12/12) 团队git

Windows Server 2012 KMS 服务器的安装与配置 - Klamath - 51CTO技术博客

个人比较懒,本来想写些SCVMM2012的安装配置心得,一直懒得动手,结果有人写出很详细的博文,我就更懒得动笔了,于是沉寂了几个月,最近开始捣鼓Windows Server 2012,也拿到了KMS的key,开始在单位部署Windows Server 2012了. 刚刚部署了Windows Server 2012的批量激活服务器,虽然KMS服务器做起来很简单,但我觉得还是有必要留一个文档,总有人用的到吧. 在Windows Server 2008 R2上装批量激活服务器,只需用slmgr.vbs

博客链接

不错的博客 http://www.cnblogs.com/xdp-gacl/p/5149171.html http://www.cnblogs.com/

进度表及,我的博客链接出错应该是:http://www.cnblogs.com/grs1216/ 一班28号 老师帮忙重新改一下3次作业 谢谢

学习进度表 周数 专业学习目标 专业学习时间 新增代码量 博客发表量 知识技能总结 4 弄懂双链表代码含义及原理 3小时 60 1 双链表可能有点抽象,遗忘,可能性大,要经常复习 5 练习HTML动态表格 3小时 100 1 大致了解实际却有点问题 6 看编程有关进站POP,出站push  4小时 100 1 了解了与栈有关的知识 还是有点模糊 ,7  完成HTML所教的连连看小游戏  6小时  80 2 只做到一个一个翻页却无法完成点击同一个也匹配成功的BUG 8           9  

修改电脑HOSTS登陆Google网【仅供学习使用】--给个其他网站博客链接

HOSTS 如果最新的不可用,建议网友试试其它的,或许会有奇迹发生. 因为博主经常会用到Google相关服务,所以会较劲脑汁,不择手段在互联网上寻找可用且快速的hosts:1. 找到hosts这个文件,在Windows 系统下是位于C盘/windows/system32/drivers/etc目录里.2. 以记事本的方式打开hosts,添加下载文件中的地址并保存就可以了. 博主大神链接 蜂巢's Blog /*PS:希望博主大神不会介意小的私自将你的博客地址传出去了