What Elements Can You Use in Schemas?

So which elements do schemas support? You can see an overview in Table 5-2. You'll see many of these elements at work as you build schemas in this chapter.

Table 5-2. Schema Elements
Type Description
all Permits the elements in a group to appear in any order in the containing element.
annotation Creates an annotation.
any Permits any element from the given namespace(s) to appear in the containing sequence or choice element.
anyAttribute Permits any attribute from the given namespace to appear in the containing complexType element or the containing attributeGroup element.
appinfo Specifies information to be used by applications within an annotation element.
attribute Creates an attribute.
attributeGroup Groups attribute declarations so that they can be used as a group for complex type definitions.
choice Permits oneand only oneof the elements contained in the group to appear in the containing element.
complexContent Contains extensions or restrictions on a complex type that contains mixed content or elements only.
complexType Defines a complex type, which supports attributes and element content.
documentation Holds text to be read or used by users within an annotation element.
element Creates an element.
extension Extends a simple type or a complex type that has simple content.
field Indicates an XML Path Language (XPath) expression that gives the value to define a constraint ( unique , key , and keyref elements).
group Groups a set of element declarations so that they can be incorporated as a group into complex type definitions.
import Imports a namespace whose schema components are referenced by the containing schema.
include Includes the given schema document in the target namespace of the containing schema.
key Indicates that an attribute or element value must be a key.
keyref Indicates that an attribute or element value corresponds to the value of the given key or unique element.
list Defines a simpleType element as a list of values of a given data type.
notation Contains the definition of a notation to describe the format of non-XML data within an XML document.
redefine Permits simple and complex types, as well as groups (and attribute groups from external schema files), to be redefined in the current schema.
restriction Defines constraints, such as data types.
schema Contains the definition of a schema.
selector Indicates an XPath expression that selects a set of elements for an identity constraint for the unique , key , and keyref elements.
sequence Requires the elements in the group to appear in the given sequence within the containing element.
simpleContent Contains extensions or restrictions on a complexType element with character data or a simpleType element as content. Contains no elements.
simpleType Defines a simple type.
union Defines a simpleType element as a collection of values from given simple data types.
unique Indicates that an attribute or element value must be unique.


Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net