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

ANY

When you declare an element with the content model of ANY, it means that the declared element can contain any type of content—any element in the document as well as parsed character data. (Effectively, this means that the contents of elements you declare with the ANY content model are not checked by XML validators.)

Here's how you specify a content model of ANY:

<?xml version = "1.0" standalone="yes"?> 
<!DOCTYPE DOCUMENT [
<!ELEMENT DOCUMENT ANY>
]>
<DOCUMENT>
</DOCUMENT>

However, giving an element the content model ANY is often not a good idea because it removes syntax checking. It's usually far better to specify an actual content model, and I'll start doing that with a child list of elements.

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