如何使用jericho html解析器从html或jsp页面获取注释

时间:2014-05-14 16:13:20

标签: jericho-html-parser

如何获得//Comments&等评论来自html和jsp页面的/*Comments*/

我使用jericho html解析器以下列方式获得了评论<!--Comments--><%--Comments--%><%Comments%>

List<Tag> comments = source.getAllTags(StartTagType.COMMENT);(<!--Comments-->)
List<Tag> serverSideComments = source.getAllTags(StartTagType.SERVER_COMMON_COMMENT);
(<%--Comments--%>)
List<Tag> serverComments = source.getAllTags(StartTagType.SERVER_COMMON);("<%Comments%>")

但我无法找到//&amp; /*Comments*/

1 个答案:

答案 0 :(得分:0)

html中的注释必须以&lt;开头。如果添加一些用//表示的内容将被解释为文本。 http://www.w3schools.com/html/html_comments.asp 我认为这是一个标准,jericho没有办法自定义标签。

相关问题