3.1
XML Schema Design Mode
When opening an XML Schema in
Design Mode you will likely see the visual
layout of your file something similar to this:
|
Figure 9. XSD Design Mode
|
Looking at the layout above you can see your XML Schema laid out
for you in a visual overview. Across the top you have the
namespace that your schema is defined in. Your
Directives are like Java Imports, they are external
references that the XML Schema is making use of. Below that you
have the
Types that make up your XML Schema and to the left of
the
Types are the
Elements. These are the structural definition of the
document laying out the
Types into a tree along with rules stating multiplicity,
ordering and so on.
On the right hand side of the screen you should see the
Outline and
Properties views for the file as well, that look
something like this:
|
Figure 10. Outline and Properties
views
|
The
Outline view shows you the same information you saw in
the overview, but as you navigate through the overview, in and
out of types and elements the
Outline view will always give you a reference point of
where you are. You can also edit the XSD from the
Outline view, very similar to how it was done during the
XML Editing section above.
As you make selections of
Elements and
Types in the
Outline view the
Properties view will update, showing you the properties
for the node you have selected. You can change the values
directly from the
Properties view, overview or context menus. Giving you
plenty of ways to work with your XML Schemas.
Double-clicking on an
Element can jump you immediately into a view that is
specific to that element like below:
|
Figure 11. Double-click an
element
|
After double clicking you will be shown that element displayed by
itself and how it is defined:
|
Figure 12. web-app element
overview
|
From this view we can see that the
web-app element was defined as type
web-appType. So we see here a structural overview of the
web-app element. Given the first grouping multiplicity
on the far left, we see we can have 0 or more of the sequence
starting with
distributable and ending with
security-role.
Of course each of those allowable children can have their own
multiplicity specified as well. That way the top level group
specifies an ordering for the child elements, but the individual
multiplicity on the children allows authors to specify 0 or more
of the same tag one after the other (e.g. like multiple
servlet tags in a web.xml file).
You can also edit the content of the schema from this view by
right-clicking on any portion of the overview and being presented
with a context menu:
|
Figure 13. Right-clicking in the
overview allows you to edit
|
Editing in this fashion can also be done from the
Outline view, very similar to the XML Editor above. In
the following example screenshot we are showing how to edit the
grouping of a type directly from the
Outline view (you can do the same from the overview if
you prefer):
|
Figure 14. Outline view editing
|
Lastly, as you begin using the XML Schema editor you may notice
that the overview for
Types looks different than the overview for
Elements, something like this:
|
Figure 15. Type overview
|
The difference is that the
Type overview shows a break-out of the types for each
field. Each of these types that define the fields of
this type are themselves other types defined in
the XSD. As an example, an XSD might define 3 types:
-
id, integer
-
name, string
-
dob, datetime
Now let's say the XSD also defines the type
Person that uses all these sub-types:
-
Person
-
social-security (type: id)
-
full-name (type: name)
-
birth-date (type: dob)
That is similar to what you are seeing in the layout above. You
are simply seeing a breakout of the sub-types that make up the
type you are looking at. You can drill further down into the
sub-types if you want to determine more information about the XML
Schema.
|