Rafał Piekara
Rafał Piekara

Reputation: 74

XML formatting comparison

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?

Upvotes: 0

Views: 31

Answers (1)

Michael Kay
Michael Kay

Reputation: 163478

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.

Upvotes: 1

Related Questions