-1

如何从 html 标签中扫描自定义属性?
这是示例代码。
未定的自定义属性名称。

<table>
    <tr>
        <td mycustom-attr1="true"></td>
        <td mycustom-attr2="true"></td>
        <td mycustom-attr3="false"></td>
    </tr>
</table>
<table>
    <tr>
        <td mycustom-attr1="true"></td>
        <td mycustom-attr2="true"></td>
        <td mycustom-attr3="false"></td>
    </tr>
</table>

我想从这个 html 标记中提取到“mycustom-attr1、mycustom-attr2、mycustom-attr3”,
搜索 1000 多个 jsp 页面。

任何idia?

4

1 回答 1

1

您可以在大多数现代语言中使用

举例:

/html/body/table[1]/tr/td/@*[starts-with(name(), 'mycustom')]

输出

 mycustom-attr1="true"
 mycustom-attr2="true"
 mycustom-attr3="false"
于 2013-02-13T01:08:29.590 回答