Skip to Main Content
XML and Related Technologies
book

XML and Related Technologies

by Atul kahate
May 2024
Beginner to intermediate content levelBeginner to intermediate
527 pages
17h 52m
English
Pearson India
Content preview from XML and Related Technologies
XML Schemas • 177
The pattern facet allows us to deal with such requirements.
We will first see an example and then go into the syntactical details of this facet. Suppose that we want
to define a three-digit book code, to start with. The resulting scheme declaration is shown in Figure 4.41.
<xsd:simpleType name = “BookCodeType”>
<xsd:restriction base = “xsd:string”>
<xsd:minLength value = “5”/>
<xsd:maxLength value = “5”/>
<xsd:pattern value = “\p{Nd}\p{Nd}\p{Nd}”/>
</xsd:restriction>
</xsd:simpleType>
Figure 4.41 Example of a pattern facet – 1
The full schema (bookcode1.xsd) and the corresponding XML document (bookcode1.xml) are shown
in Figure ...
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

XML Schema

XML Schema

Eric van der Vlist
XML in a Nutshell, 3rd Edition

XML in a Nutshell, 3rd Edition

Elliotte Rusty Harold, W. Scott Means
Beginning XML, 5th Edition

Beginning XML, 5th Edition

Danny Ayers, Liam R.E. Quin, Joe Fawcett

Publisher Resources

ISBN: 9781282652262