Skip to Content
Real World XML
book

Real World XML

by Steven Holzner
January 2003
Beginner to intermediate content levelBeginner to intermediate
1200 pages
23h 42m
English
Peachpit Press
Content preview from Real World XML

Child Element Lists

Besides using the content model of ANY, you can specify that the element you're declaring contains another element by giving the name of that element in parentheses, like this:

<?xml version = "1.0" standalone="yes"?> 
<!DOCTYPE DOCUMENT [
<!ELEMENT DOCUMENT (CUSTOMER)*>
]>
<DOCUMENT>
    .
    .
    .
</DOCUMENT>

In this case, I'm indicating that the root element, <DOCUMENT>, can contain any number (including zero) of <CUSTOMER> elements. (The way I specify that the <DOCUMENT> element can contain any number of <CUSTOMER> elements is with the asterisk after the parentheses, and we'll see how that works in a page or two.)

The <DOCUMENT> element can contain any number of <CUSTOMER> elements, so I can now add a <CUSTOMER> element to the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Inside XML

Inside XML

Steven Holzner
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0735712867Purchase book