XML Schema Solution

I am developing an XML schema to store the output of my program. Nevertheless, I doubt the constructive solution, and I would like to get more experienced programmers.

If I have a complex element

<list>
<elmt>1</elmt>
<elmt>2</elmt>
</list>

However, nested elements in <list>are optional. My question is, what should the file look like in the absence <elmt>?

Option 1:
 <list/> or  <list></list>

Option 2:  <list size="0" />

Option 3: Remove the item <list>altogether.

I know that these 3 options may not make any difference, but does anyone have any preferences for some reason (I care more about reading an XML file faster and easier programming than size)?

+3
source share
2

2. 1 ( , ) 3, XML ( , ). , .

+1

- <list>

<list> , <elmt>

<list> , . <list thing="value">, <list> , , <elmt>

0

Source: https://habr.com/ru/post/1736080/


All Articles