Why doesn't XML have Bag?

Betty L. Harvey harvey at eccnet.eccnet.com
Fri Mar 26 13:28:10 GMT 1999


Roger:

	I am not sure what you mean by "Bags" but XML supports
any type of list.  It also supports content tables which are
pretty cool:

As an example:

<!ELEMENT list (item+)>
<!ELEMENT item (#PCDATA)>

<list>
        <item>Item1</item>
        <item>Item2</item>
</list>

Example Content Tagged Table

<!ELEMENT part-table (part+)
<!ELEMENT part       (partno, nomen, price,
                      quantity)>
<!ELEMENT (partno | nomen | price | quantity) (#PCDATA)>

<part-table>
	<part id='1'>
		<partno>1</partno>
		<nomen>My Part</nomen>
		<price>$1.00</price>
		<quantity>10</quantity>
	</part>
        <part id='2'>
                <partno>2</partno>
                <nomen>My Part 2</nomen>
                <price>$2.00</price>
                <quantity>20</quantity>
        </part>       
</part-table>

Depending on your application you can do some
pretty interesting things with the parts
list.  You can do the same thing with 
a list if required.

I am not sure if this is what you were looking
for.

Betty

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey                         | Phone: 301-540-8251 FAX: 4268
Electronic Commerce Connection, Inc. | 
13017 Wisteria Drive, P.O. Box 333   | 
Germantown, Md.  20874               |
harvey at eccnet.com                    | Washington,DC SGML/XML Users Grp
URL:  http://www.eccnet.com          | http://www.eccnet.com/sgmlug/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/  



On Fri, 26 Mar 1999, Roger L. Costello wrote:

> Why doesn't XML support the notion of an unordered list of elements,
> i.e., a Bag?  Perhaps this is a limitation of DTD, not XML?  That is,
> DTDs do not support Bags, but XML has no such inherent limitation?  Does
> DCD support Bags?  /Roger
> 
> 
> xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
> Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
> To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
> (un)subscribe xml-dev
> To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
> subscribe xml-dev-digest
> List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
> 


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list