background image

Inline Customizations

<< Inline and External Customizations | External Binding Customization Files >>
<< Inline and External Customizations | External Binding Customization Files >>
C
USTOMIZATION
O
VERVIEW
37
bindings without having to modify the source schema, and enables you to easily
apply customizations to several schema files at once.
Note: You can combine the two types of customizations--for example, you could
include a reference to an external binding customizations file in an inline annota-
tion--but you cannot declare both an inline and external customization on the same
schema element.
Each of these types of customization is described in more detail below.
Inline Customizations
Customizations to JAXB bindings made by means of inline binding declarations
in an XML schema file take the form of
<xsd:appinfo>
elements embedded in
schema
<xsd:annotation>
elements (
xsd:
is the XML schema namespace pre-
fix, as defined in W3C XML Schema Part 1: Structures). The general form for
inline customizations is shown below.
<xs:annotation>
<xs:appinfo>
.
.
binding declarations
.
.
</xs:appinfo>
</xs:annotation>
Customizations are applied at the location at which they are declared in the
schema. For example, a declaration at the level of a particular element would
apply to that element only. Note that the XMLSchema namespace prefix must be
used with the
<annotation>
and
<appinfo>
declaration tags. In the example
above,
xs:
is used as the namespace prefix, so the declarations are tagged
<xs:annotation>
and
<xs:appinfo>
.