Defining a simpleType in the Tree View

This topic provides the steps for defining an atomic simpleType in the Tree view. When you are familiar with this procedure, you can adapt it to define list, union, and anonymous simpleTypes.

In the Tree view, to define an atomic simple type:
1. Click the node you want to define a simpleType for. This can be one of the following types of nodes:
    • schema
    • element
    • attribute
    • list
    • union

To define a simpleType as the sibling of another node, click the node and hold down the Shift key when you click the button in step 2. You cannot, of course, define a simpleType as a sibling of the Schema node.

2. In the left tool bar, click New simpleType . Stylus Studio displays an empty simpleType field as the last child of the node you selected. If you held down the Shift key, the field is the last sibling of the selected node.
3. Type a name for the new simpleType and press Enter.
4. In the left tool bar, click New Restriction . A restriction specifies the type that the new simpleType is derived from. This is the base type.

Stylus Studio displays a scrollable list of XML Schema built-in types, and any simpleTypes you already defined in this schema. Descriptions of the XML Schema built-in types are in the W3C XML Schema Part 0: Primer.

5. Double-click the simpleType that you want to base your new simpleType on.
6. In the left tool bar, click New Facet . A facet specifies a constraint on the range of values provided by the base type. Stylus Studio displays a scrollable list of XML Schema facet types. For a description of each facet, see About Facet Types for simpleTypes.

You must ensure that you specify a facet that is valid for the specified base type. Stylus Studio does not prevent you from specifying an invalid facet. The W3C XML Schema Part: 0 Primer includes a table that provides this information.

7. Double-click the type of facet you want to specify.
8. In the Properties window, double-click the Value field.
9. Enter a value for the new facet.
10. To add another facet, click the restriction node for your simpleType, and repeat step 6 through step 9.

Educational Institutions That Use Stylus Studio

Education is the most powerful tool one can have. That's why these top education providers reach for Stylus Studio to educate their students and professors as well. See which education providers have the most powerful XML IDE in their classrooms!

Validate XML Using XSD

You can validate XML documents against any data model defined using W3C XSD, using any major XSD Validator, including MSXML 3.0, MSXML 4.0, MSXML 6.0, Xerces-J, Xerces-C, Microsoft System.XML (1.0 and 2.0), XSV, the Saxonica XSD Validator and others.

Building Workflow Applications with XML

Learn how to design custom XML workflow applications - from modeling your data and information processes, to capturing input from users in XML, and finally, generating useful queries and reports from the XML data -- using XSLT & XQuery technologies.

Generating Java Code with Stylus Studio

This is a video tutorial on how to generate Java Code with Stylus Studio

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member