- 循环路径下的每一个不同的子路径都会在字段处生成一个字段
- xml文件中有几个循环路径就会生成多少条记录 循环会进入该路径下的子路径,也就是字段处的路径
- 每一次循环都会生成一条记录
- 如果没有子路径不会生成字段 可以通过在字段中xml路径选项填写
.
获取该路径下的文本,通过@<属性名>
获取该路径的属性,字段名需要自己填写
*XPath* | *JSONPath* | *Result* |
---|---|---|
/store/book/author | $.store.book[*].author | the authors of all books in the store |
//author | $…author | all authors |
/store/* | $.store.* | all things in store, which are some books and a red bicycle. |
/store//price | $.store…price | the price of everything in the store. |
//book[3] | $…book[2] | the third book |
//book[last()] | $…book[(@.length-1)] $…book[-1:] | the last book in order. |
//book[position()< 3] | $…book[0,1] $…book[:2] | the first two books |
//book[isbn] | $…book[?(@.isbn)] | 筛选出所有带有isbn的记录 |
//book[price<10] | $…book[?(@.price<10)] | filter all books cheapier than 10 |
//* | $…* | all Elements in XML document. All members of JSON structure. |
*XPath* | *JSONPath* | *Description* |
---|---|---|
/ | $ | the root object/element |
. | @ | the current object/element |
/ | . or [] | child operator |
… | n/a | parent operator |
// | … | recursive descent. JSONPath borrows this syntax from E4X. |
* | * | wildcard. All objects/elements regardless their names. |
@ | n/a | attribute access. JSON structures don’t have attributes. |
[] | [] | subscript operator. XPath uses it to iterate over element collections and for predicates. In Javascript and JSON it is the native array operator. |
| | [,] | Union operator in XPath results in a combination of node sets. JSONPath allows alternate names or array indices as a set. |
n/a | [start:end: step] | array slice operator borrowed from ES4. |
[] | ?() | applies a filter (script) expression. |
n/a | () | script expression, using the underlying script engine. |
() | n/a | grouping in Xpath |
在/head路径下有三个子路径/img,当循环路径使用/head时,会生成img字段,但是由于有三个img路径,所以只能生成第一条路径下的文本作为记录
循环路径是重复进入该路径名里面的路径,如果该路径下没有子路径,则无法使用获取字段
字段下的xml路径是获取该路径下的所有内容放进字段中