XML: What to use as a list separator

Posted by Heinzi on Stack Overflow See other posts from Stack Overflow or by Heinzi
Published on 2010-04-19T10:47:16Z Indexed on 2010/04/20 0:23 UTC
Read the original article Hit count: 501

Filed under:
|

There are two ways to specify lists of values in XML. Variant 1:

<Database Name="myDatabase">
    <Table Name="myTable1" />
    <Table Name="myTable2" />
    <Table Name="myTable3" />
    ...
</Database>

Variant 2:

<Database Name="myDatabase" Tables="myTable1 myTable2 myTable3 ..." />

Clearly, Variant 1 is cleaner and can be extended more easily, but im many cases Variant 2 is more readable and "user-friendly".

When using Variant 2, what should be used as the separator? The XML Schema standard seems to prefer whitespace, whereas some real-world examples use commas instead.

Is there a particular reason to choose one over the other (assuming that the values contain neither whitspace nor commas)?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xml-schema