O'Reilly logo

XML Companion, The, Third Edition by Neil Bradley

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

Patterns

The 'pattern' facet clearly requires more explanation than the brief description above. This XML Schema feature is based on the regular expression capabilities available in the Perl programming language, and is therefore very powerful, but also consequently quite complex.

Simple templates

The Pattern element holds a pattern in its Value attribute. The simplest possible form of pattern involves a series of characters that must be present, in the order specified, in each element or attribute definition that uses it. The following pattern restriction specifies that the value must be 'abc':

<pattern value="abc" />

In this simple form, a pattern is similar to an enumeration. Just as a restriction can contain multiple Enumeration 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