O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required