valid-xml-schema-type
Overview
This rule belongs to the xml-validation
ruleset and states that:
The type
attribute is used to define the data type of an element or attribute in an XML Schema document. The value of the type must either be a simple XML schema standard type e.g. string
, integer
, boolean
etc. or a valid name (qualified/unqualified) of a simple/complex type defined in the same or an external XML schema document. If type information is not found, type string
will be assumed by default when importing/transforming in APIMatic.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Provided type could not be resolved. |
Code | XML_V401 |
Type | Validation |
Rule System | Syntax |
Broad Category | XML Schema |
Tags | xml preliminary checks validation type schema |
Suggested Fixes
- If you intend to use a built-in standard type name, ensure that it matches with the standard version exactly and that there are no typos. Values are compared in a case-sensitive manner.
- If the XML schema document(s) make use of multiple namespaces, ensure that the type name is properly qualified i.e. contain a namespace prefix followed by the local type name. The format to be used is [namespace prefix]:[local name].
- If your type name uses a qualified name, ensure that the namespace prefix it uses is pre-defined using a valid namespace value.
- If the referenced type exists in an external XML schema ensure that the path provided for the external schema (in includes/imports) is valid and publicly accessible.
- If the referenced type exists in an external XML schema ensure that the XML schema document contains a valid schema definition.
- If you are trying to reference a complex type ensure that a <complexType> component exists with the provided
name
attribute value. - If you are trying to reference a simple type ensure that a <simpleType> component exists with the provided
name
attribute value.
For More Information
- https://www.w3.org/TR/xmlschema11-1/#xsi_type
- https://www.w3.org/TR/xmlschema11-1/#sec-builtin-primitives
- https://www.w3.org/TR/xmlschema11-1/#Simple_Type_Definition
- https://www.w3.org/TR/xmlschema11-1/#Simple_Type_Definitions
- https://www.w3.org/TR/xmlschema11-1/#Complex_Type_Definition
- https://www.w3.org/TR/xmlschema11-1/#Complex_Type_Definitions
- https://www.w3.org/TR/xmlschema11-1/
- https://www.w3.org/TR/xml/
- https://docs.apimatic.io/rulesets/overview/