2022-11-07
|
ZH
/** * 清除所有标签(只清除标签,不清除标签体) * @param src xml/html * @param tags tags * @return String */ public static String removeTag(String src, String ...tags)
2023-03-08
|
ZH
如果后台日志提示[检测数据库适配器][检测失败][检测其他可用的适配器] 说明根据数据源连接信息没有找到合适的适配器(这个适配器用来为不同的数据库生成特定的SQL) 如连接信息中是 mysql数据库,但没有依赖anyline-data-jdbc-mysql 也有可能没有扫描org.anyline这个
2022-01-25
|
ZH
从html中抽取多个标签,如需要抽取a标签和li标签 最简单的是抽取两次 RegularUtil.fetchAllTag(html,"a") RegularUtil.fetchAllTag(html,"li") 但这样有个问题,两个标签的顺序会乱, 如果需要保持顺序可以通过RegularUtil.fetchAllTag(html,"a","li"); 但是一定注意:这里
2022-01-01
|
ZH
在截取html时经常会遇到html标签被破坏的情况,这时需要识别出截止位置是否处于某个标签内部,如果在标签内容需要定位到标签的结束位置
2022-11-07
|
ZH
/** * 获取所有 包含attribute属性并且值=value 的标签与标签体 * 单标签只匹配有/>结尾的情况,避免与双标签的开始标签混淆 * 如class="a" : attribute=class value=a * style="width:100px;" :attribute=style value=width * [ * [整个
2022-11-07
|
ZH
/** * 根据属性名 删除标签(只删除标签,保留标签体) * @param src xml/html * @param attribute 属性名 * @return String */ public static String removeTagByAttribute(String src, String attribute) RegularUtil.removeTagByAttribute
2022-11-07
|
ZH
/** * 删除 tags之外的标签只写一次 "b" * 只删除标签不删除标签体 * @param src html * @param tags tags * @return String */ public static String removeTagExcept(String src, String ...tags)
2022-11-07
|
ZH
org.anyline.util.regula.RegularUtil /** * 删除所有标签的属性 * @param src html * @param attributes 属性 如果不传则删除所有属性 * @return String */ public static String removeAttribute(String