kettle XML文件输入

  • 循环路径下的每一个不同的子路径都会在字段处生成一个字段
  • xml文件中有几个循环路径就会生成多少条记录 循环会进入该路径下的子路径,也就是字段处的路径
  • 每一次循环都会生成一条记录
  • 如果没有子路径不会生成字段 可以通过在字段中xml路径选项填写.获取该路径下的文本,通过@<属性名>获取该路径的属性,字段名需要自己填写
*XPath**JSONPath**Result*
/store/book/author$.store.book[*].authorthe authors of all books in the store
//author$…authorall authors
/store/*$.store.*all things in store, which are some books and a red bicycle.
/store//price$.store…pricethe 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/aparent operator
//recursive descent. JSONPath borrows this syntax from E4X.
**wildcard. All objects/elements regardless their names.
@n/aattribute 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/agrouping in Xpath

在这里插入图片描述
在/head路径下有三个子路径/img,当循环路径使用/head时,会生成img字段,但是由于有三个img路径,所以只能生成第一条路径下的文本作为记录

在这里插入图片描述
循环路径是重复进入该路径名里面的路径,如果该路径下没有子路径,则无法使用获取字段
在这里插入图片描述
字段下的xml路径是获取该路径下的所有内容放进字段中
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值