Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should a list be represented in XML?

Tags:

list

xml

In XML, how should a list be represented?

With an enclosing list entity:

<person>
    <firstname>Joe</firstname>
    <lastname>Bloggs</lastname>

    <children>
        <child .../>
        <child .../>
        <child .../>
        <child .../>
        <child .../>
    </children>
</person>

Or without:

<person>
    <firstname>Joe</firstname>
    <lastname>Bloggs</lastname>

    <child .../>
    <child .../>
    <child .../>
    <child .../>
    <child .../>
</person>
like image 653
Mat Avatar asked Jan 15 '09 23:01

Mat


People also ask

What is a list in XML?

XML List takes an XML document as a request and returns an XML document with the requested data. A list can represent data in a table, a business view, or data from a table conversion. Using data from a table conversion enables you to use multiple tables.

What is the correct XML element tag structure?

XML Naming RulesElement names must start with a letter or underscore. Element names cannot start with the letters xml (or XML, or Xml, etc) Element names can contain letters, digits, hyphens, underscores, and periods. Element names cannot contain spaces.

What is XML formatting?

What is XML? The Extensible Markup Language (XML) is a simple text-based format for representing structured information: documents, data, configuration, books, transactions, invoices, and much more. It was derived from an older standard format called SGML (ISO 8879), in order to be more suitable for Web use.

What is Xsd list?

Definition and Usage The list element defines a simple type element as a list of values of a specified data type.


1 Answers

For extensibility, I would use the first solution (the one with the children node). If you ever wish to store any data about all of the children then you have a convenient node on which to place attributes.

like image 145
Jason Jackson Avatar answered Nov 03 '22 10:11

Jason Jackson