如何更改此XML? [英] How to change this XML?

查看:75
本文介绍了如何更改此XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我已经编写了如下所示的XML,但我认为它不好,我想对其进行更改:

Hello,everyone! I have written a XML like below,but I think it is not good and I want to change it:

<Height>
  <Standard4721>
  <PN PN="1.6">
  <A DN="250">300</A>
  <A DN="350">400</A>
  <A DN="450">500</A>
  </PN>
  <PN PN="2.5">
  <A DN="250">300</A>
  <A DN="350">400</A>
  <A DN="450">500</A>
  </PN>
  </Standard4721>
</Height>



您能给我一些关于如何使其更好的建议吗?非常感谢!



Could you give me some suggestions about how to make it better?Thank you very much!

推荐答案

不确定更好"的意思.尽管从上下文本身可以很好地表明您可以进行改进,但也很难从上下文中分辨出XML应该代表什么.也就是说,使您的XML更加不言自明. "PN"代表什么? "A"代表什么?和"DN"?另外,我看到您在第一个PN中拥有的三个A看起来与在第二个PN中具有三个A的相同...也许这表明您可以采用不同的结构来删除此重复项(尽管,也许不是).

另外,通常应缩进XML以提高可读性.因此,所有A都应缩进另一个层次. "4721"的作用是什么?为什么不将其作为节点的属性而不是使其成为节点名称的一部分呢?不知道更多,这就是我能给您的所有建议.
Not sure what you mean by "better". It''s also hard to tell from context what your XML is supposed to represent, though that in itself could be a good indicator of an improvement you could make. That is, make your XML more self-explanatory. What does "PN" stand for? And what does "A" stand for? And "DN"? Also, I see that the three A''s you have in the first PN look identical to the A''s in the second PN... perhaps this is an indicator that you could structure it differently to remove this duplication (though, maybe not).

Also, you should typically indent XML for readability. So, the A''s should all be indented another level. And what is the "4721" for? Why not put that as an attribute of the node rather than make it part of the node name? Without knowing more, that''s really all the advice I can give you.


这很难回答.

您的xml代表什么?定义更好?结构或清晰度更好?如果不多看,根本不可能提出任何建议.
Well that is very hard to answer.

What does your xml represent? Define better? Better in structure or definition? With out looking more it simply is not feasible to give any suggestion.


这篇关于如何更改此XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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