XML格式比较(XML formatting comparison)

编程入门 行业动态 更新时间:2024-10-18 18:18:31
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.

更多推荐

本文发布于:2023-07-22 09:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219138.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:格式   XML   comparison   formatting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!