xml spy
Previous  Top  Next
Schema, Content model

XML Spy enables you to define your content model with a few mouse clicks. All element types and methods of combining them can be defined in the content model.

Compositors

A "Compositor" defines an ordered sequence of sub elements (child elements).

To insert a compositor:
1.Click right on the element you want to add sub elements to.  
2.Select Add Child | Sequence (Choice or All).  
3.Click right on the compositor symbol and select Add Child | Element, to add further sub elements.  

Sequence:
usr_sch_mod_seq
Choice:
usr_sch_mod_choice
All:
usr_sch_mod_all

To change the compositor (model)

1.Click right on the compositor.  
2.Select Change Model | Sequence (Choice or All).  

Global components
There are two methods of defining global components: creating a new component from scratch, or changing an existing element into global component.

To create a global component from scratch
:
1.Click the Insert / Append icon in the Schema Overview, and select the type of component you want (Element, Group, SimpleType, ComplexType etc.)  
2.Enter the name of the component in the global list, and confirm with OK.  

The global component appears in the respective tab (Elm, Grp, Com, Sim etc.) of the Component navigator. Double clicking on the component, displays the tree view of that component in the main window.

Please note:  
You can create a global element while viewing a component in the content model. Click right in the main window, and select the option New Global | Element.  

To delete a global component:

1.Switch to the Schema global overview, select the component and hit the delete key, or  
2.Click the Delete icon ic_delete of the component window.  

To change an element into a global component:

1.Click right on the element and select Make Global | Element.  

If the element is a complex type, then the option Make Global | Complex type becomes available.

References to global components
A reference to a global component can be created in two ways:
·You add a component to a schema which has the same name as an existing global component. This causes a dialog box to appear, prompting you if you want to reference the element to it. Confirming with OK, references the component to the component definition.  
·You right click an element and select the option Reference from the context menu.  

In both cases, a link icon appears at the bottom left of the element symbol usr_sch_isref2 and check box "isRef" is set active in the Details entry helper.

ref_p106a

Please note:  
If you create a reference to a component that does not exist, the element name appears in red as a warning that there is no definition to refer to.  

To view the definition of an element:

·Use the Hotkey CTRL+Double click on an element.  
The element definition appears, along with the corresponding info in the details window, or  
·Right click the element and select Go to Definition from the context menu.  

To edit the name of an element:
1.Right click the element  
2.Select the context menu option Edit | Name and edit the name. (Double clicking the element name, also enables you to edit the name.)  

To edit the annotation of an element:

1.Right click the element.  
2.Select the context menu option Edit Annotation. (Double clicking the element annotation, also enables you to edit the annotation.)  

To edit (or create) appinfo for an element:

1.Right click the element.  
2.Select the context menu option Whole Annotation Data.  
This opens the Annotation dialog box. If an element contains annotation text, then a row is visible when the dialog box is opened. The annotation type "doc", is displayed in the Kind column and the annotation text is visible in the Content text box.  

new_whole_annotations  

3.Click the append ic_schem_appor insert icon at the top left, to insert a new line. This automatically inserts a new "doc" line.  
4.Click the drop down arrow next to the new doc line, and select "app".  
5.Double click in the Source column to enter a URI, it is not mandatory that you enter one however.  
6.Enter the appinfo content text, in the Content text box.  
 
Configuring the content model view
·Select the menu command Schema design | View config.  

This command allows you to configure the content model view. The dialog box opens at the bottom right of the XML Spy window, giving you room to see changes reflected in the content model immediately. The settings you define here, apply to the schema documentation output as well the printer output.

Changing element parameters/values directly in the content model
·Double click the cell of the element (table) you want to edit and start entering data. If a selection is possible, a drop down list appears if not, enter the parameter or value and confirm the entry with the Return key.  

The entry helpers will be updated at this point, reflecting the data you entered.  

schema_conf_edit  

Documenting the content model
·Select the menu command Schema design | Generate documentation.  

This command generates detailed documentation about your schema. Documentation is generated for each element using the settings you define in the dialog box. Related elements (child elements, complex types etc.) are hyperlinked, enabling you to navigate from element to element.

Previous  Top  Next

© 2002 Altova