XML文件的转换 - 将属性值和值更改为属性值
我是否有一种方法可以在XML中制作“开关”,就像我在标题中在标题中更改为标签属性的属性值,并将值转换为标签属性的值。 示例:
<attribute name="Krantyp">value</attribute>
<attribute name="Beschreibung">value2</attribute>
要变成这样的东西:
<attribute Krantyp="value" Beschreibung="value2"/>
因此,在此示例中,标签是“属性”,属性名称的值必须成为属性(名称不再存在!),这里的“ krantyp”成为新属性。标签“值”的值成为新属性“ krantyp”的值,依此类推。
这甚至可能吗?如果是这样,最好的方法是什么?
Is there a way to make "switches" in XML, as I explained in title changing attribute values into attributes of tag, and values into values of attributes of a tag.
Example:
<attribute name="Krantyp">value</attribute>
<attribute name="Beschreibung">value2</attribute>
to turn into something like this:
<attribute Krantyp="value" Beschreibung="value2"/>
so, in this example, tag is "attribute", value of attribute name has to become attribute (name not exists anymore!), here "Krantyp" becomes new attribute. Value of tag "value" becomes value of new attribute "Krantyp" and so on.
Is this even possible? If it is, what would be the best way to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一探究竟。
输入XML
XSLT
输出XML
Check it out.
Input XML
XSLT
Output XML