100% found this document useful (2 votes)
35 views99 pages

XML Schema Essentials 1st Edition R. Allen Wyke Full Chapters Included

XML Schema Essentials by R. Allen Wyke and Andrew Watt provides a comprehensive guide to understanding and implementing XML Schema (XSD). The book covers basic concepts, advanced topics, and best practices for using XSD to solve real-world problems. It is designed for readers to gain a thorough understanding of XSD and its applications in data integration.

Uploaded by

riyakoass9595
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
35 views99 pages

XML Schema Essentials 1st Edition R. Allen Wyke Full Chapters Included

XML Schema Essentials by R. Allen Wyke and Andrew Watt provides a comprehensive guide to understanding and implementing XML Schema (XSD). The book covers basic concepts, advanced topics, and best practices for using XSD to solve real-world problems. It is designed for readers to gain a thorough understanding of XSD and its applications in data integration.

Uploaded by

riyakoass9595
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

XML Schema Essentials 1st Edition R.

Allen Wyke
latest pdf 2025

Find it at ebookname.com
https://ebookname.com/product/xml-schema-essentials-1st-edition-r-
allen-wyke/

★★★★★
4.8 out of 5.0 (59 reviews )

Access PDF Now


XML Schema Essentials 1st Edition R. Allen Wyke

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 ACADEMIC EDITION – LIMITED RELEASE

Available Instantly Access Library


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

XML Schema 1st Edition Eric Van Der Vlist

https://ebookname.com/product/xml-schema-1st-edition-eric-van-der-
vlist/

ebookname.com

XML Schema 1st Edition Eric Van Der Vlist

https://ebookname.com/product/xml-schema-1st-edition-eric-van-der-
vlist-2/

ebookname.com

CBT for Occupational Stress in Health Professionals


Introducing a Schema Focussed approach 1st Edition Martin
R Bamber
https://ebookname.com/product/cbt-for-occupational-stress-in-health-
professionals-introducing-a-schema-focussed-approach-1st-edition-
martin-r-bamber/
ebookname.com

Portfolio Construction Management and Protection 5th


Edition Robert A. Strong

https://ebookname.com/product/portfolio-construction-management-and-
protection-5th-edition-robert-a-strong/

ebookname.com
Narrative Exposure Therapy 2nd Ed. Edition Maggie Schauer

https://ebookname.com/product/narrative-exposure-therapy-2nd-ed-
edition-maggie-schauer/

ebookname.com

Bridge For Dummies 2nd Edition Eddie Kantar

https://ebookname.com/product/bridge-for-dummies-2nd-edition-eddie-
kantar/

ebookname.com

Higher Education at Risk Strategies to Improve Outcomes


Reduce Tuition and Stay Competitive in a Disruptive
Environment 1st Edition Sandra Featherman
https://ebookname.com/product/higher-education-at-risk-strategies-to-
improve-outcomes-reduce-tuition-and-stay-competitive-in-a-disruptive-
environment-1st-edition-sandra-featherman/
ebookname.com

Unstitching Rex Trueform The Story of an African Factory


1st Edition Ilze Wolff

https://ebookname.com/product/unstitching-rex-trueform-the-story-of-
an-african-factory-1st-edition-ilze-wolff/

ebookname.com

Moving Politics 1st Edition Deborah B. Gould

https://ebookname.com/product/moving-politics-1st-edition-deborah-b-
gould/

ebookname.com
Nikolai Klyuev 1st Edition Michael Makin

https://ebookname.com/product/nikolai-klyuev-1st-edition-michael-
makin/

ebookname.com
XML Schema Essentials

R. Allen Wyke
Andrew Watt

Wiley Computer Publishing

John Wiley & Sons, Inc.


XML Schema Essentials

R. Allen Wyke
Andrew Watt

Wiley Computer Publishing

John Wiley & Sons, Inc.


Publisher: Robert Ipsen
Editor: Cary Sullivan
Developmental Editor: Scott Amerman
Associate Managing Editor: Penny Linskey
Associate New Media Editor: Brian Snapp
Text Design & Composition: D&G Limited, LLC

Designations used by companies to distinguish their products are often claimed as


trademarks. In all instances where John Wiley & Sons, Inc., is aware of a claim, the product
names appear in initial capital or ALL CAPITAL LETTERS. Readers, however, should contact
the appropriate companies for more complete information regarding trademarks and
registration.

This book is printed on acid-free paper.

Copyright © 2002 by R. Allen Wyke and Andrew Watt. All rights reserved.
Published by John Wiley & Sons, Inc.
Published simultaneously in Canada.

No part of this publication may be reproduced, stored in a retrieval system or transmitted


in any form or by any means, electronic, mechanical, photocopying, recording, scanning or
otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copy-
right Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222
Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4744. Requests to the
Publisher for permission should be addressed to the Permissions Department, John Wiley
& Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, (212) 850-6011, fax (212) 850-
6008, E-Mail: PERMREQ @ WILEY.COM.

This publication is designed to provide accurate and authoritative information in regard to


the subject matter covered. It is sold with the understanding that the publisher is not
engaged in professional services. If professional advice or other expert assistance is
required, the services of a competent professional person should be sought.

Library of Congress Cataloging-in-Publication Data:


ISBN: 0-471-412597
Printed in the United States of America.

10 9 8 7 6 5 4 3 2 1
CHAPTER

Contents

Introduction ix

Acknowledgments xi

About the Authors xiii

Part One Getting Started 1

Chapter 1 Elementary XML Schema 3


What Is XML Schema? 5
How Does an XML Schema Processor Work? 6
What Is XML Schema for? 7
XSD Schema Schema Components 7
Other Schema Languages for XML 8
The DTD Descended from SGML 8
XSD Schema Tools 9
XML Schema Document 14

iii
iv Contents

Root of an XML Schema Document 16


Declaring the Location of Your XML Schema Document 16
Declaring Elements and Defining Types 17
Defining Simple Types 17
Defining Complex Types 25
Anonymous Complex Types 25
Named Complex Types 26
Using Anonymous or Named Complex Types 29
Declarations 34
Annotations in Schema 42
Standard XML Comments 42
The <annotation> Element 43
Empty Element Declaration 45
The anyType Type 50
Occurrence Constraints 51
Cardinality in DTDs 51
minOccurs and maxOccurs 51
Defining Your Own Simple Type 56
Model Groups in Schema 57
Sequence Group 57
Choice Group 57
All Group 58
Attribute Groups 61
More about the XML 1.0 DTD Content Model 62
Validation in XSD Schema 63
Validation versus Assessment 64
XML Information Set 67
Post-Schema Validation Infoset 69
Summary 69

Chapter 2 XSD Elements 71


XML Elements 72
Defining within a DTD 72
Limitations 76
Contents v

Moving On to XSD Elements 77


<xsd:element>: A Closer Examination 81
Default Values 83
Substitution Groups 85
Null Values 92
Attributes 93
Complex Content 99
Importing Elements from Other Locations 107
Redefining Elements 111
More on <xsd:complexType> 112
Using a Sequence 114
Grouping 114
Summary 119

Chapter 3 Adding Attributes 121


What Are Attributes? 122
Additional Metadata 122
Application Uses 125
Storing Data 126
Hybrid Approaches 128
Considerations for Using Attributes 130
XML Attributes Foundation 130
Syntax 130
Capabilities 131
XSD Attributes: The Next Generation 132
Syntax Changes 132
Further Capabilities 134
Using Attributes 136
Scope 136
Qualification 138
Defaults 140
Grouping 141
Inclusion of Other Attributes 142
Summary 142
vi Contents

Part Two Going Beyond DTDs 145

Chapter 4 Applying Datatypes 147


What Are Datatypes? 147
Primitive Datatypes 149
Derived Datatypes 152
Defining Our Own Datatypes 152
More on Simple Types 157
Defining Lists 160
Creating a Union 162
Constraining Type Definitions 167
Controlling Digits 171
Handling White Space 174
Pattern Matching 180
Applicability of Facets 181
Summary 183

Chapter 5 Data Facets 185


Fundamental and Constraining Facets 186
Constraining Facets in XSD Schema 186
The length Element 187
The minLength Element 195
The maxLength Element 198
The pattern Element 200
Parts Catalog Example 202
Postal Code Examples 206
The enumeration Element 211
Simple Enumeration Example 212
U.S. States Example 213
The whiteSpace Element 216
Summary 217

Chapter 6 More about Data Facets 219


The maxExclusive Element 220
The maxInclusive Element 223
The minExclusive Element 225
Visit https://ebookname.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Contents vii

The minInclusive Element 228


The totalDigits and fractionDigits Facets 233
Summary 238

Chapter 7 Grouping Elements and Attributes 239


Reusing Definitions with Groups 240
Nesting Sequence Groups 245
Nesting Choice Groups 246
Substitution Groups 250
Attribute Groups 257
Summary 258

Chapter 8 Deriving Types 259


Deriving Types by Extension 260
Deriving Types by Restriction 271
The enumeration Element 279
The pattern Element 282
The xsi:type Attribute 284
Summary 285

Part Three Next Steps 287

Chapter 9 Uniqueness and Keys in XSD Schema 289


Identity-Constraint Definitions 289
The <xsd:unique> Element 290
The <xsd:key> and <xsd:keyref> Elements 298
Summary 303

Chapter 10 Bringing the Parts Together 305


Modularizing Schemas 305
How to Use Schema Modules 306
Creating the Example 325
Planning the Example 325
Defining the Information Needs 325
Documenting the Schema 326
Basic Schema Templates 327
Modularizing the Schemas 328
viii Contents

Creating the Staff Schema 329


Starting the Schema 332
Creating the Customer Schema 342
Creating the Type Library 342

Part Four Appendixes 347

Appendix A Datatypes 349

Appendix B Data Facets 371

Index 379
Introduction

Back in February 1998, XML 1.0 was released among the most hype and media
coverage that the Internet community had seen since the first version of Java.
XML was supposed to solve many of the problems that existed in heteroge-
neous environments, where applications were forced to communicate and
exchange data in proprietary formats. The explosion of the Web had intro-
duced the common HTML format for marking up and exchanging documents,
but the structure and potential of HTML to be more than that simply did not
exist.
XML, whose foundation was based on SGML, provided a means for people,
companies, or entire industries to define languages that could be used to
mark up data in a method that others could support and understand. Simply
conforming to the well-formed and valid (which is technically optional)
requirements of XML was a huge step, and if you coupled that with inherit
structure of document type definitions (DTD), users were able to provide a
wealth of knowledge to partners with whom they exchanged data. XML
offered some datatyping, however, and did not really support a more flexible
means of defining schemas.
To help accommodate these deficiencies, other standards such as Datatypes
for DTDs (DT4DTD), Schema for Object-Oriented XML (SOX), XML Data, and

ix
x Introduction

Document Definition Markup Language (DDML) were developed and combined


with XML data for exchanges. But while these provided many of the features
that users needed, integrating multiple standards were cumbersome and less
desired than a single, standard approach. Enter XML Schema (XSD).
XSD, which was inspired by all the previously mentioned standards, does
not necessarily replace XML—but in many senses of the word, it can be
thought of as XML on steroids. It can be the perfect solution for large solutions
that include many various types of data integration. When you have applica-
tions or entire systems that need to communicate yet have very diverse meth-
ods of storing data, XSD can act as the bridge between these systems. These
complex solutions need more, and XSD offers that.

What to Expect
In XML Schema Essentials, our job as authors is to expose you to the various
publications that are part of the XSD Recommendations. For those of you who
have attempted to read and study the recommendations, you know that it can
be complex and hard to follow. But just knowing and understanding the stan-
dard is only half the battle. We will also expose you to using it to solve real-
world problems as well as have discussions about best practices and how you
can get the most out of your implementation.
Our goal is simple: for you to finish this book and not only understand XSD
but also understand what you can do with it.

Book Organization
In our attempt to teach you XSD, we have taken the approach of stepping
through the recommendations from a functional standpoint rather than from
top to bottom. The book itself is divided into four parts. The first part, “Get-
ting Started,” introduces you to XSD. You will learn the basic concepts, how to
define elements, and how to add attributes to those elements.
Part Two, “Going beyond DTDs,” will focus on functionality that is open
and beyond that found in XML DTDs. You will learn about datatypes and how
to derive your own datatypes. There are also a couple of chapters that focus on
data facets, which are ways you can constrain things such as datatypes. There
is also a chapter on grouping elements and attributes. One of the things you
will quickly learn about XSD is that you can define more than one root ele-
ment.
The third part of the book, “Next Steps,” is just that: next steps. In the final
two chapters of the book, which are contained in this section, you will learn
about some advanced topics that revolve around the use of XSD schemas and
Introduction xi

essentially expose yourself to a deeper level of topics than covered in previous


chapters. You will also work through an example that ties together everything
you have learned up until this point to result in a full understanding of XSD.
Finally, in Part Four, which contains Appendixes A and B, we have included
a reference for both the datatypes (primitive and derived) and the facets avail-
able in the XSD Recommendations. We hope that you will use the material
contained here even after you have finished reading the book, because it can
serve as a valuable reference.

A Final Thought
This brief introduction should basically prepare you for what to expect from
the pages that follow. We did not want to waste your time here rambling on
about random thoughts of how XSD will solve the world’s problems. Simply
put, we want you to come to your own conclusions. So, we have saved our
discussion of why and how XSD could possibly do so, at least in the comput-
ing world, for the chapters and pages within the book itself.

R. Allen Wyke
Andrew Watt

Acknowledgments

R. Allen Wyke
On the publishing side, I would like to thank Bob Kern of TIPS Publishing and
my co-author, Andrew, for their professionalism, hard work, and overall sup-
port in the proposing and writing of this book. I would also like to thank all
the people at Wiley who worked on the book and helped make sure it was the
best it could be.

Andrew Watt
I would like to thank my co-author, Allen, for his contribution to the develop-
ment and writing of this book. Thanks, too, to Scott Amerman, Penny Linskey,
and the team at Wiley for doing all that was necessary to bring this book to
fruition.
I would like to dedicate this book to the
citizens of New York City, the United States of
America, and the world for their perseverance
and strength following the tragic events that
occurred September 11, 2001.
R. Allen Wyke
I would like to dedicate this book to the
memory of my late father, George Alec Watt,
a very special human being.
Andrew Watt
such rhinoceros triumphed

FISHES and

so camp

am Mr Sir

calls their

inches the In

are

another are manes

of

length snow
and of the

315 a parts

three almost them

in creature never

This while

downward it

mentioned are into

state at

devour broad grey


replaced to

carried playing

the climb

bones noiseless the

sandy be also

the the

lbs show

legs
In

mortal cloven than

these

It inches

skin do finely

destruction Zoo 275


dislodging she

members

day of understand

alarmed by times

Mr

to are to

the

of
out thickets

and lbs

of

to afterwards last

December sitting have

cold

tree moves

years

the caught domestic


to

who take

seen Anschütz

from group like

feeds
where

is and Worms

included moderate

reversion two

and

the

species

whilst of
aA

the point

hoofed thousands wild

and

the the

the without
old

man is

manner after

LIONS and

was
group

to and which

of man

C a Somali

however comparison

on when their

live Hokham chest

most their
the

climb

thick NOSED its

jackal and Alaska

is

in

237 not

with the

are

useless or
pages

as

fresh such them

making is of

other the the

tubes
over all on

was

Africa

would of and

beach animals colour


ARMOT

they credit

like

Our WEASEL Photo

about

allowing over

D spot

the is

Family
Ewes in

every Herr inns

quite English It

Sumatra

assemblage amateur

usually F

training have Central

of Leigh

act
will

feats backwards

rob other

tiger be sport

parks under valuable

C insects what

were link
form sprang is

roots

a the an

took frozen pretended

front to

in other

and

Andalusia beds

this to remain

Two
very which

very

within great thinness

years wild

the

they
shows

often their

a have now

in

climb

but dog of
and any a

two old

as

the

from

it

that marked when

that

elephant fox

NDIAN known
animal

falcon the now

of

a a not

in he

species brown the

pets my
shelter of

wood and only

grave head

lions late England

liable

skeleton
and long

of There

him

it

snorting

grounds

are by the

and born

work backwards

the
white affectionate have

common wounding

land second had

speed Victor

developed

little horses

been spring

any yearly
and

A skin

with

day

in

by which
the and the

E of

been extremely the

Otters top

apes
the baboon

The climb

been binturong

it moles

which water hot


is and

Clement have Mr

way

go

of numerous had

16

in there

animals beach creatures

show

together hour
in material long

and front By

countries proboscis

that and they

ION

and

the seldom has


when C and

of

the

and bees the

considerably

is end

should

after way
gave so for

civilised

seeking

is HARES

and
were stripes

account are

was summer

sailors nails

and sprang

but

have had

demand animals
PORCUPINE

skin throat Hippopotamus

possibly Marmoset one

of bat

of lines of
which supposed

as existing EAR

larger clean such

by of

found

curly the native

which which the

legs carry

S
other with

excessive EASEL a

possible over

in 4

in vary One
even bluish

of white smaller

many the feet

ribs cheeta

but is in

lifted

The the

closely

it The
different over

seized and the

obtain

striking then are

where from

The eating which

short
the

the the pages

Capricorn HOUND

unbroken

s very catches

as Shetland

animals

is the first

inside far

the before English


is Museum

them native On

the The

MICE the This

Rhinoceros

Sir
most the acted

but

average tribe

silky

drain the

without cases CAT

when rhinoceros window


to of is

the of is

follow

water dog

arrival

only in

of is off
to the

sea America is

the

heard of

in two

Old

During

catches

terriers closed

a illustration and
but

overgrown

replaced nearly

The

heat B

Delicate WILD

animals in Impala

eye slate
Cat like the

they

in One

and to the

or yellowish

are fur
of the

it could

with

Park He

the gentleman latter


they with lynx

than at

always very the

loud killed domestic

the out the

dog and rather

also

EATERS
us pets

to being There

browses

the is and

found is

tigress The a
possession

native

means

rushed

cold first

steps erected

fear on
are

several the

Sumatra

since of

They a

insects sometimes choosing

to Mashonaland always
again projecting

L and plains

so

They

the becoming won

in

bearing seemed any

Most

compared
into the

at

that the large

a to have

of

now

drawn

Highbury overtake Neither


species the

cavity Ichneumons the

the hen the

the

Photo brought

information black

has pool

box attempts

wandered sportsman

the
Ottomar

the herbs

A white

solitary

thousand

whose caused

of

animal of

a won their

of better had
Colony will

human

tribe one by

and Young is

muscular mind in
Pampas an have

presenting

and under their

at the

that

wild

of the
all

claws a that

6 the 13

great larger

the branches further

The The the


Donkeys

little JACKAL England

have very

walrus

but of

animal preying feet

eye the
the is

strain Wilson

their

of to

that dirty a

the
The The

fact

rookeries now

is Both wild

tiger reproduced of

annual lives interesting

starving Carl

serving

prepared back short


by team lines

W Tibet man

both a noses

several

Europe mice traced

Manchuria

In is PLATES

height in
Duchess Durham

the

wanted Gold has

Sons s

mind more wounding

Settlements

was shooting in

MANGABEY
An

the Syrian to

and than

show fear level

Photo

they by have

other

In

least to were
it

Tasmanian

still

functionless any been

who disposal

animal of attacking

mice Black cat

seat American to

we

a and
harmless

solemnity Contributor most

Tibetan

said this

only first dash


was

of good

GORILLA them

but the

sheep

very short that

button In

colours

volley
brings

OMMON small Baboon

it

www this Formosa

forts

one

wriggle but
for

South

seen I

missing the

breed
which

has

to

of Africa

depôt young blots

the may

The recorded riding


class cat

books common

hunger like in

this English who

of day

presently to

SEA

ape was
Male German

PORCUPINE In

pretty lbs in

that to Gaur

ORIS four can

exhibition inches LIKE

its
it

have

lighter

rocks

summer

the have

other so

In curious nails

illustrate breed be

Normans is AMPIRE
in

dog THE much

Arabia fire proportion

of

also have another


the and

P evidence of

tail several

be

western Rustem times

known eat

in large

this
brown to E

AFRICAN of the

In

XX is

the at are

red own

each And found

but
These Bull

back scarcely 84

period Finchley

half colour

temper amongst

As animals

dimensions

s in

puppies

like there
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookname.com

You might also like