XML格式比较(XML formatting comparison)
我有一个奇怪的XML格式问题。
是
<SomeObject Name="SomeName" Surname="Surname" Age="23" />同样如下:
<SomeObject> <Name>SomeName</Name> <Surname>Surname</Surname> <Age>23</Age> </SomeObject>你能检查并告诉我这两个标记是否相同吗?
I have a strange issue with XML formatting.
Is
<SomeObject Name="SomeName" Surname="Surname" Age="23" />the same as:
<SomeObject> <Name>SomeName</Name> <Surname>Surname</Surname> <Age>23</Age> </SomeObject>Could you check and tell me if those two markups mean the same?
最满意答案
其中一个片段使用带属性的元素,另一个使用带子元素的元素。 这不是格式差异,它是一种不同的数据建模方式。
你的问题究竟是什么? 如果你问这两个片段是否相同,那么答案是否定的,但事实并非如此。
One of your snippets uses an element with attributes, the other uses an element with child elements. That's not a formatting difference, it's a different way of modelling your data.
What exactly is your question? If you're asking whether these two snippets are the same, then the answer is no, they aren't.
更多推荐
发布评论