更改 xml 文件的格式以匹配新的 .XSD 架构? [英] Change the format of an xml file to match a new .XSD schema?

查看:22
本文介绍了更改 xml 文件的格式以匹配新的 .XSD 架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码覆盖率 xml 文件,我需要对其进行更改以符合要由程序解释的不同 .xsd 架构.做这个的最好方式是什么?我已经为此任务研究了 XSLT,但我不确定我是否走上了正确的道路.我没有使用 xml、xslt 或 xsd 的经验.

I have a code coverage xml file that I need to change to comply with a different .xsd schema to be interpreted by a program. What is the best way to do this? I've researched XSLT for this task, but I'm not sure if I'm going down the right path with that. I have no experience with xml, xslt, or xsd.

推荐答案

要将数据从一种 XML 格式转换为另一种 XML 格式,XSLT 通常是正确的选择.但是,它是一种相当复杂的语言,如果您不太了解它,可能会令人沮丧.

To convert data from one XML format to another XML format, XSLT is usually the right choice. However, it is quite a complex language and may be frustrating if you don't know it well.

如果您基本上只需要重命名 XML 中的几个节点,那么使用一些简单的 XSLT 就可以了.

If you basically just need to rename a few nodes in the XML, you'll be fine with some simple XSLT.

如果您有两种格式的 XSD,您可能需要查看像 Altova MapForce 这样的映射工具(有点贵,当然有更便宜的选项),它允许您以图形方式在模式之间进行映射,而不是编写XSLT 直接.

If you have XSDs of both formats, you may want to look into a mapping tool like Altova MapForce (somewhat expensive, there certainly are cheaper options out there) that allow you to map between the schemas in a graphical way instead of writing XSLT directly.

这篇关于更改 xml 文件的格式以匹配新的 .XSD 架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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