Architecting and designing : XML schema design : The XML diagram : Definition and symbol properties : XML element
  
XML element
An element is the smallest unit of stored data, which means that it cannot be broken down further, or that it makes no sense to break it down further.
Definition properties
Values that you enter in the definition properties of an element apply to the element wherever it is used in the encyclopedia: they are global properties.
Note An element is represented by its name and the schema it represents. For example, if you create an element person in a diagram representing the DTD Orders, and then create a second element person in a diagram representing the DTD Payroll, these will be two different elements. If you create a third element person in a third diagram, also representing the DTD Orders, then the first person and the third person will share the same definition (even though there will be two separate 'instances' of the graphical symbol).
Model
BizTalk
open: Elements in an open model may contain subelements and attributes from any namespace. However, if they are of the same namespace, the schema must define an ElementType or AttributeType.
closed: Element content may not include subelements. Element content may include “mixed” content if it is included in the content model.
DTD
any: In a DTD, a combination of the model property “open” and the order property “many” translates to “any”:
<!ELEMENT Element_1 ANY >
ignored: Your DTD may contain conditional code. This text is imported and concatenated in the Ignored Text property. However, this text cannot be exported, and is not referenced where it originally appeared in the schema.
Order
The order property specifies whether subelements are required to appear in a certain order, and if only one subelement of a set can appear.
seq: Indicates that subelements appearing in an instance document must appear in the order listed in the schema. The order of elements generated to the schema will be the order of elements seen graphically on the diagram, from left to right.
Example output:
<!ELEMENT item (number,% onhand;,price,description) >
one: Specifies that only one subelement can be used from a list of subelements.
Example output:
<!ELEMENT item ( number|%onhand;| price|description) >
many: Specifies that the subelements may appear in any order, and in any quantity.
Example output:
<!ELEMENT item ( number|%onhand;| price|description)* >
The default value for order is seq when the content attribute is set to eltOnly, and the default is many when content is set to mixed.
Data Type (BizTalk only)
See Descriptions of data types.
Content
empty: The element content will contain no text or subelements. Empty elements may only have attributes as content.
textOnly: Element content will contain only text. Error R20 will be reported when using datatype on an Element Type if the content is not set to “textOnly”.
eltOnly: Element content will only consist of subelements.
mixed: The default content type of an element. Mixed elements may have both text and subelements as content.
Text Entity References
Element content can be a simple text substitution consisting of a finite sequence of characters.
A text entity reference of the form %textref can be entered in the Element Content, Attribute Data Type, Attribute Required, Attribute Default and Attribute Values properties.
To change a symbol and set its property to %textref, double-click the symbol. In the appropriate property field, change the value to %textref, and then click OK.
Text Entity Schema (XML Schema)
Text Entity Schema is used to resolve the text entity references in the properties of this object. If this value is blank, it will use the diagram schema.
Comments
Text in the Comments field will be generated into the schema file but will be formatted as follows:
<!--your comments go here-->
See also Location of generated comments and processing instructions.
Processing Instructions
Processing Instructions are passed to an application. They typically contain a declaration of the target application and whatever instructions the application needs to process the XML schema.
Text in the Processing Instructions field will be generated into the schema file but will be formatted as follows:
<?--your processing instructions go here-->
See also Location of generated comments and processing instructions.
Description
Text in the Description field does not get generated to a DTD, but is generated to a BizTalk schema. You may enter a description of the modeling element, or its use in the schema. The description can be included in a report. By default, it is included in HTML reports.
XML Schema
Specifies one and only one schema (see What is an XML schema?) that will be used throughout the diagram, and/or the XML Schema definition that elements and attributes are keyed to. Note that all elements and element attributes created on the diagram will default to this schema name. Attribute and element symbols may be keyed to one and only one schema. If the schema is renamed, all elements and attributes that use it will be re-keyed to the new name. “Names” may be the same as long as they are keyed to different schemas.
The attribute and element instances will use the diagram’s schema by default, however, this is not required. Element and attribute symbols using schema outside of the diagram’s will display with dotted borders.
Source properties
System Architect translates specific data modeling and object oriented definition types that are dropped onto an XML diagram. Once on an XML diagram, System Architect allows you to view the original definition.
Source Entity
The dropped entity name
Source Class
The dropped class name
Source Attribute
The dropped attribute name
Source Table
The dropped table name
Source Data
The dropped data element name.
Source Column
The dropped column name
Source Class Attribute
The dropped class attribute name
Instance Properties
Data specified in an element’s Instance properties are Element properties in BizTalk and Content Model properties in DTDs that apply to the instance of the element you are editing: the one you graphically see on the diagram you are in.
An element’s Instance properties are not inherited across instances of the element: they are not global. In other words, all three instances of the element symbol person above, even the first and third ones which share the same definition, will have different values in their Instance properties.
MinOccurs
0: Minimum value is zero. Specified element is not required.
1: Element must occur at least once.
MaxOccurs
1: Element will occur at least once
*: Element will occur an unspecified number of times.
Namespace Prefix
(BizTalk only)
A Namespace Prefix declares a URI for the instance of the element type. It allows you to ensure uniqueness among same named elements.
Comments
Text in the Comments field will be generated into the schema file but will be formatted as follows:
<!--your comments go here-->
See also Location of generated comments and processing instructions.
Processing Instructions
Processing Instructions are passed to an application. They typically contain a declaration of the target application and whatever instructions the application needs to process the XML schema.
See also Location of generated comments and processing instructions.
Graphic Comment
The graphic comment is the name given to the symbol description for both BizTalk and DTDs. It is generated to BizTalk as a description element; it is not generated in DTDs. The graphic comment property may be displayed in a number of ways on the diagram, and it is recognized by all of the reporting and documenting systems, import/export mechanisms, encyclopedia merge/extract utility, etc.
To display the graphic comment on the diagram, right-click the symbol and choose Display Mode from the list. Make sure that the Graphic Comment choice is selected. In most cases, the text of the comment will be displayed on the diagram workspace, in close proximity to the symbol itself.
To connect the comment to its symbol with a line, select Format, Diagram Format, Notation. In the Notation dialog, select Draw Line to Remote Text.
To display the graphic comment in the symbol itself, select Format, Symbol Format, Text Position. In the Text Position dialog, clear Graphic Comment in the Position Outside group, so that the comment is positioned inside the symbol.
XML Schema
Specifies one and only one What is an XML schema? that will be used throughout the diagram, and/or the XML Schema definition that elements and attributes are keyed to. Note that all elements and element attributes created on the diagram will default to this schema name. Attribute and element symbols may be keyed to one and only one schema. If the schema is renamed, all elements and attributes that use it will be rekeyed to the new name. “Names” may be the same as long as they are keyed to different schemas.
The attribute and element instances will use the diagram's schema by default, however, this is not required. Element and attribute symbols using schema outside of the diagram’s will display with dotted borders.
See also
Definition and symbol properties