Database Reference
In-Depth Information
Global Elements
Suppose that we want to use XML Schema to represent a document that extends the cus-
tomer data in Figure 11-53 to include the salesperson assigned to that customer. Further,
suppose that both customers and salespeople have address and phone data. We can use the
techniques shown thus far to represent this new customer structure, but, if we do so, we will
duplicate the definition of Phone and Address.
In the relational world, we worry about duplication of data not so much because of wasted file
space, but more because there is always the chance of inconsistent data when one copy of the data
is changed and the other copy is not changed. Similarly, in the document-processing world, people
worry about the duplicate definition of elements because there is always the chance that they will
become inconsistent when one is changed and the other is not. As shown in Figure 11-54, elements
can be declared globally and then reused to eliminate the definition duplication.
Figure 11-54
Example of a Schema
with Global Elements
(a) XML Schema with Global Phonetype Element
 
Search WWH ::




Custom Search