XSLT比较XML节点的属性 [英] XSLT compare attributes of XML nodes

查看:58
本文介绍了XSLT比较XML节点的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试合并2个XML文件,首先我需要根据节点中的2个属性比较两个文件的节点。如果这3个属性相等,我需要用新的节点替换现有节点。例如,第一个xml文件就像;

Hi all,
I am trying to merge 2 XML files that first of all i need to compare nodes of both files according to 2 attributes in the nodes. If those 3 attributes are equal, i need to replace the existing node with the new one. For example first xml file will be like;

展开 | 选择 | Wrap | 行号

推荐答案

你放入一个属性节点太多了。使用
you put in one attribute node too many. use


node2而不是


node2 / @ *。 1)


a如果没有if子句,那将更加精巧
node2/@*. 1)

a more elagant way would be without the if clause
展开 | 选择 | Wrap | 行号


这篇关于XSLT比较XML节点的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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