XSL根据文本查找值 [英] XSL to find values based on text

查看:86
本文介绍了XSL根据文本查找值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下XML输入,我从中选择来自CustPermId,BankProdId,CustPayeeId节点的字符串值,并形成另一个请求将其发送到不同的服务。  下面的请求将是动态的,可以有一个(CustPermId,BankProdId
或CustPayeeId)或多个Filter标准。

I have below XML input from which I have pick string values from CustPermId, BankProdId, CustPayeeId nodes and form another request to send it to different service.  Below request will be dynamic and there can be one (either CustPermId, BankProdId or CustPayeeId) or more than one Filter criterias will be there.

例如,如果请求中存在CustPermId,我想选择值001,在这种情况下,BankProdId的值应为002,等等。

For example, if CustPermId is there in request, I want to pick value 001, and same for BankProdId in this case value shall be 002 so on.

推荐答案

使用XPath

Well with XPath

  //表达式[LeftOperand / PropName ='CustPermId']​​ / RightOperand / Literal / Val

  //Expression[LeftOperand/PropName = 'CustPermId']/RightOperand/Literal/Val

应该为您的样本提供'001'。这有帮助吗?如果您需要有关XSLT转换输入XML的帮助,请考虑使用XSLT为您发布的输入样本发布要创建的输出样本。

should give you '001' for your sample. Does that help? If you need help with XSLT transforming your input XML then consider to post the output sample you want to create with XSLT for your posted input sample.


这篇关于XSL根据文本查找值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆