且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

这是有效的xpath查询吗?

更新时间:2023-11-27 13:42:34

ShaggyInjun, 我认为您正在寻找符合以下条件的东西:

ShaggyInjun, I think you're looking something in lines with:

//dataOptions[id]
//dataOptions[id="id2"]

我最近编写了一个名为"defiant.js"的js库-使用该库,可以使用XPath对JSON结构进行查询.在这种情况下-我已在此页面上粘贴了您的JSON数据:

I have recently written a js-lib called "defiant.js" - with which one can make queries on JSON structure with XPath. To put in in this context - I've pasted your JSON data at this page:

http://www.defiantjs.com/#xpath_evaluator

...并在视觉上测试了不同的XPath查询,再次验证了该结构.评估程序突出显示JSON及其XML对应项中的匹配项.

...and visually tested different XPath queries agains the structure. The evaluator highlights the matches both in JSON and its XML counterpart.

我希望您发现"defiant.js"及其网站有用.

I hope you find the "defiant.js" and its site usefull.