xml - 如何进行 XSLT 转换?
问题描述
我有下面的xml文件结构,但我需要将其转换为节点“Type1”中“Shipper”和“Supplier”的结构
你能告诉我如何用 xslt 做到这一点吗?
<Data>
<Shipper>11111</Shipper>
<Supplier>22222</Supplier>
<Type1>
<NumberOfConnections>2</NumberOfConnections>
<Quantity>
<Amount>2042</Amount>
<Unit>AAAAA</Unit>
</Quantity>
<UserCategory>GGV</UserCategory>
</Type1>
</Data>
我希望有如下文件中的结构:
<Data>
<Type1>
<Shipper>11111</Shipper>
<Supplier>22222</Supplier>
<NumberOfConnections>2</NumberOfConnections>
<Quantity>
<Amount>2042</Amount>
<Unit>AAAAA</Unit>
</Quantity>
<UserCategory>GGV</UserCategory>
</Type1>
</Data>
谢谢!
解决方案
推荐阅读
- c - 读取现有文件以在c中处理数据
- ios - Mapbox iOS:打开设备定位服务后未显示用户位置
- google-cloud-functions - 谷歌云功能中的额外网络费用
- mingw-w64 - 编译 hello.cpp 时找不到 libisl-15.dll
- c# - 有没有办法防止 XML 在序列化后输出多余的 XML 数据?
- c++ - 计算 HOG 特征时,opencv 断言失败错误 438
- android - 颤振错误:RangeError(索引):无效值:不在0..2范围内,包括:3
- php - 如何从 IOS 应用程序的 MySql 数据库中获取用户名和密码变量?
- gcc - REGSITER_TM_CLONES 中的 Shift 操作的目的是什么?
- typescript - 安装 @google-cloud/storage 后如何解决 Firebase 函数中的 Typescript 类型错误