Architecting and designing : XML schema design : The XML diagram : XML rules checking : Rules check
  
Rules check
These are the possible error conditions that are checked. Many of these conditions, and the wording of the corresponding message, are from the Microsoft XML parser. Others are specific to System Architect and XML Architect.
Rule 2: No name
Error (2) = "A Symbol must have a name."
A symbol must have a name. You are not allowed to drop an unnamed symbol onto a diagram. You will receive a warning that the element must be named.
As soon as a symbol is dropped onto the diagram, it gets a name consisting of its type, a hyphen, and a unique number. You can overtype that name, and then press Enter. To change the name of an existing symbol, right‑click the symbol, and then click Symbol Rename.
If you have made customization to the tool (via USRPROPS.TXT) to get around the above behavior, and have symbols on a diagram with no name, running the Rules Check flags symbols without a name on the diagram with Error (2).
Rule 3: No definition
Error (3) = "A symbol must have a definition."
In System Architect and XML Architect, you work with diagrams, on which you draw symbols, that have underlying definitions. This rule flags any symbol that does not have an underlying definition: for example, the symbol was drawn on the diagram, but you never opened its definition dialog (by double-clicking the symbol or right-clicking it and choosing Edit).
Rule 4: No schema
Error (4) = "- missing XML Schema property"
A symbol must have an XML Schema. You are not allowed to create an XML diagram without specifying the schema the diagram represents.
For more information on defining XML Schemas, see XML schema.
Rule 7: No attribute reference definition
Error (7) = "- could not find Attribute Type definition."
This error flags the fact that an attribute symbol has an Attribute Type, but that Attribute Type is not defined.
To define the Attribute Type, open the attribute symbol’s definition dialog, click the Symbol tab, and then click Define under XML Attribute Type.
Rule 11: Bad name XML
Error (11) = "Name cannot start with the letters 'xml'."
The name of a schema, an element, an attribute, or a group cannot start with the letters xml (in either upper case or lower case).
Rule 12: Unexpected whitespace
Error (12) = "Names cannot contain spaces."
Symbol names cannot contain spaces between words. To rename a symbol without the extra space, select the symbol on an open diagram, right-mouse click, and select Symbol Rename. This will rename the symbol selected.
Rule 13: Bad start name character
Error (13) = "Names cannot begin with a number."
The name of a schema, an element, an attribute, or a group cannot start with a number.
Rule 14: Bad name character
Error (14) = "Names cannot contain the characters '&><:'."
The name of a schema, an element, or an attribute cannot start with the characters shown.
Rule 15: Data type values missing
Error (15) = "The values for enumeration type are missing."
This error flags the fact that an element or an attribute has a data type of Enumeration but its Values property is empty.
See also Descriptions of data types.
Rule 16: Default wrong
Error (16) = "The Default must be one of the items specified in the Values property."
This error flags the fact that an element or an attribute has a data type of Enumeration, and it has a list of Values, but the value specified in the Default property is not found in the list of Values.
See also Descriptions of data types.
Rule 17: Required has default
Error (17) = "This attribute is marked as required and the default value will always be used."
If an attribute is required, it should not have a default value. This error flags the fact that in the attributes symbol properties, its Required property is set to Yes, but its Default property has a value.
You should either make the attribute not required, or delete the default value.
Rule 18: Bad character in enumeration
Error (18) = "Invalid character in values list for enumeration: one of '><&' found."
An enumeration is a set of values, for example, color = red, blue, indigo. This error flags the fact that you have a bad character in the element or attributes Values list. The following are considered bad characters: >, <, and &.
Rule 19: Multiple attribute value
Error (19) = "Enumeration datatype must be used for Values."
XML Schema documents provide a mechanism for defining enumerations to constrain attribute or element string content. In simpler terms, an enumeration is a set of values, for example, color = red, blue, indigo.
This error message flags the fact that the attributes Values property has values in it, but no data type is specified.
Select the data type enumeration.
Rule 20: Element data type not supported
Error (20) = "An element that has any datatype must have its content set to textOnly."
This error flags an element with a data type, whose Content is NOT textOnly (i.e mixed, empty or eltOnly). If an element has a data type its Content must be set to textOnly.
Change the Content to textOnly if you want the data type, or remove the data type if the Content should not be textOnly.
Rule 21: Element type order disabled
Error (21) = "Order must be 'many' when content is 'mixed'."
This error flags the fact that the element's Content property is set to mixed, but its Order property is not set to many.
Rule 22: Element type content unknown
Error (22) = "- Content must be of type 'empty', 'eltOnly', 'textOnly', 'mixed' or resolve to a valid Text Entity definition."
This error provides a warning that the Content property of an element is not one set to one of the values above.
Open the definition dialog of an element, and set the Content property to one of the above values.
There can be a number of XML Text Entities with the same name, but different schema, and perhaps different Text properties. The one Text Entity that gets checked is the one for the same schema as the symbol, or the one with the same schema as the diagram.
See also XML text entity (DTDs only).
Rule 23: Element type model unknown
Error (23) = "The value of model must be either 'open' or 'closed'."
This error flags the fact that an element’s Model property is not set to open or closed. The only way this error could occur is if you customized the tool (via USRPROPS.TXT) to add your own model type.
Rule 24: Enumeration missing
Error (24) = "An item with a 'values' list must be of type 'enumeration'."
An enumeration is a set of values, for example, color = red, blue, indigo. This error flags the fact that in the definition of an attribute you have entered a set of values in the Values property, but have not set the attribute Type to Enumeration.
Either delete the values in the Values property of the attributes definition, or change the type of the attribute to Enumeration.
Rule 25: Attribute data type missing
Error (25) = "The Attribute's data type cannot be empty."
This error flags the fact that you have not set a Data Type for an attribute.
Open the attributes definition and click the Attribute tab. Select the Data Type from the drop down list. For more information on selecting data types, please see XML Attribute Type Properties.
Rule 27: Data type unknown
Error (27) = "- Unknown Attribute datatype."
This error provides a warning to the fact that an element or attribute has a data type that is not specified by a DTD. This error would occur if you typed in your own data type in the Data Type property of an element or attribute (or customized the tool to add new datatypes via USRPROPS.TXT, and then selected one of these new datatypes).
Rule 28: Element missing
Error (28) = "- Must provide at least one 'element' in a group."
A group symbol must have at least one child element symbol. This error flags any group symbols on a diagram that do not have at least one element symbol attached as children beneath them.
Rule 30: Group disabled
Error (30) = "- A 'group' is not allowed within an ElementType that has a 'textOnly' content model."
This error flags the fact that in an element's definition, you have set the Content property to textOnly, but you have a group symbol attached as a child to this element symbol on the diagram. If an element is text only, it cannot have a group of child elements or attributes.
Rule 31: Group is orphan
Error (31) = "- A 'group' symbol is unattached."
This error flags the fact that a group symbol is pictured on the diagram and is not connected as a child to a parent element symbol.
The group symbol is used to show a grouping of elements that have specific constraints against them. The group symbol is normally attached underneath an element, with the elements of the group attached beneath it.
Rule 32: Element disabled
Error (32) = "- Cannot contain child elements because content is set to 'textOnly'."
This error flags the fact that there are child element or attribute symbols connected underneath an element symbol on the diagram, even though the Content property of the element's definition is set to textOnly.
Rule 33: Element empty
Error (33) = "- Child element is not allowed when content model is 'empty'."
This error flags the fact that there are child element or attribute symbols connected underneath an element symbol on the diagram, even though the Content property of the element's definition is set to empty.
Rule 34: Element data type
Error (34) = "Child element is not allowed when datatype is set."
This error flags the fact that there are child element symbols connected underneath an element symbol on the diagram, even though the Data Type property of the element's definition is set to a value.
Open the element symbol's definition dialog, select the Data Type property (to highlight the value in the box), and delete the value.
Rule 35: Duplicate attribute
Error (35) = " - Cannot have duplicate Attributes on the same level."
This error will occur if there are two attributes with the same name under a parent element. This situation can only be created by importing a file with this condition.
Rename one of the attributes.
Rule 36: Multiple root symbols
Error (36) = "- More than one Root symbol found."
This is a warning that there are more than one top-level (or root) element symbols on the diagram. A valid schema has only one root symbol.
Make sure you have a single top-level element to your hierarchy tree on a diagram. Examples of error conditions are if you have two or more trees, or if you have a tree and a single element symbol sits by itself unconnected to other symbols on the diagram.
Rule 37: Root symbol not element
Error (37) = "- A root object must be an element."
This error flags the fact an attribute or group symbol sits at the top of a tree on a diagram. The top symbol of a tree must be an element symbol.
Rule 38: Attribute needs parent
Error (38) = "- Attribute symbols must be connected to a parent symbol."
This error flags the fact an attribute symbol sits at the top of a tree (or sits by itself) on a diagram. An attribute symbol must report to a parent element symbol.
Rule 41: Warning bad start name character
Error (41) = "- Schema names beginning with a number may not be accepted by all parsers."
This warning flags the fact that then name of your schema starts with a number.
Rule 42: Comment not clean
Error (42) = "- the string '--' (double-hyphen) must not occur within comments."
Comments for a symbol or definition cannot contain the string '--' (double-hyphen).
Rule 43: Missing system property on schema
Error(43) Schema name "" for Element: 'Element_1' - missing System property on schema.
You will receive an Error(43) if:
A new element or attribute symbol is keyed to a schema different than the current diagram’s.
An element or attribute reporting to a different schema is dragged onto the current diagram from the browser or the Choices dialog.
Notice that in both cases, the symbol is displayed with a dashed border.
Open the symbol’s dialog and click the Definition tab. Select the Define button underneath the XML Schema property. Enter the schema’s path name or URL in the XML schema field.
Rule 44: Does not have a valid parent symbol
Warning(44) Element Entity: 'Element_Entity_1' - does not have a valid parent symbol. Following export, subsequent import of the file will not depict the current object.
An XML Element Entity or XML Attribute Entity must have a valid parent symbol.
See also
XML rules checking