Redefining Nodes

Once you reference an XML Schema by redefining it, you are able to redefine that XML Schema's complexTypes, simpleTypes, groups, and attributeGroups. This section describes how to redefine nodes using the Diagram tab.

Extensions and Restrictions

There are two ways to redefine a node: by extension and restriction. An extension extends the base type - adding an element or an attribute definition, for example. A restriction constrains the base type - limiting a type to a certain range of values, for example.

Specifying Restriction Facets

If you define a restriction using a simpleType, the Properties window displays a section that allows you to define the facets that restrict that type, as shown in Figure 288.

Figure 288. Facets for Describing Restrictions

Restriction facets include length, minLength, maxLength, and totalDigits. For each facet you specify, you provide the facet name, a value, and, for some facets, whether or not the value is fixed. Note that not all facets apply to all types.

See About Facet Types for simpleTypes for more information on facets.

How to Redefine a Node

To redefine a node in the Diagram view:
1. Right-click the schema node .
2. Select Redefine from the shortcut menu.

The Redefine Schema Symbols dialog box appears.

Figure 289. Redefine Schema Symbols Dialog Box

3. Select the node from the redefined XML Schema you want to redefine and click OK.

The redefined node is added to the diagram, and the text for the redefined node appears in the text pane. For example, <xsd:complexType name="PublicationType"/>.

4. Right-click the redefined node.
5. From the shortcut menu, select Quick Edit > and then either Derive by extension or Derive by restriction.

The Type Derivation dialog box appears.

Figure 290. Type Derivation Dialog Box

6. Select the base type from which you want to derive the definition of the node you are redefining. and click OK.

The node you added in Figure 3 is modified in the diagram to display the restriction or extension you are using to redefine it, as shown in Figure 291.

Figure 291. Redefined Node as a Restricted simpleType

The code displayed in the text pane is also modified. For example:

<xsd:complexType name="PublicationType">
               
   <xsd:simpleContent>
               
     <xsd:restriction base="SKU"/>
               
   </xsd:simpleContent>
               
</xsd:complexType>
               

            

7. If you specified a restriction of a simpleType, specify the restriction facets in the Properties window. See Specifying Restriction Facets if you need help with this step.

Industry DTD Standards Support (OASIS)

Stylus Studio provides integrated support OASIS catalogs, including thousands of industry-standard DTDs like DocBook, FIXML, and more!

Introduction to the XQuery Mapper

This free online video demonstration covers Stylus Studio's synchronized XQuery editing and mapping tool which allows you to create any XQuery expression, either manually using Stylus Studio's XQuery editor.

Visual Data Integration Using Stylus Studio XML Pipeline

XML Pipeline is a visual data integration tool for designing, editing, debugging and deploying XML applications. This tutorial covers building a data integration application that aggregates CSV and EDI data and publishes a report to HTML and PDF.

Multi Channel Publishing

Multi channel publishing lets you go beyond single-source publishing of HTML and PDF to also generate simultaneously for non-document forms, such as to communicate with partners or drive spreadsheets.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member