1 Scope
This document provides mechanisms for a bidirectional mapping of built-in data types between OPC UA and XML. Some data types can directly be mapped in a lossless manner, for others the limitations are described.
The document defines specific OPC UA DataTypes for built-in XML data types that cannot directly be mapped and refers to an XML Schema for OPC UA DataTypes that cannot directly be mapped.
The scope of this document is not to provide a complete mapping of XML to OPC UA and vice versa. It only provides the base infrastructure by providing a mapping of built-in data types. How to map a full XML Schema with its attributes and elements to an OPC UA Information Model with ObjectTypes, VariableTypes, structured DataTypes, etc. depends on the concrete use case of the mapping and is not addressed in this document. This document can be used as a base for such a mapping.
2 Normative references
The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments and errata) applies.
OPC 10000-1, OPC Unified Architecture - Part 1: Overview and Concepts
OPC 10000-1
OPC 10000-3, OPC Unified Architecture - Part 3: Address Space Model
OPC 10000-3
OPC 10000-4, OPC Unified Architecture - Part 4: Services
OPC 10000-4
OPC 10000-5, OPC Unified Architecture - Part 5: Information Model
OPC 10000-5
OPC 10000-6, OPC Unified Architecture - Part 6: Mappings
OPC 10000-6
OPC 10000-7, OPC Unified Architecture - Part 7: Profiles
OPC 10000-7
XML Schema Part 2: XML Schema Part 2: Datatypes
http://www.w3.org/TR/xmlschema11-2/
3 Terms, abbreviated terms and conventions
3.1 Overview
It is assumed that basic concepts of OPC UA information modelling and XML are understood in this document. This document will use these concepts to describe the OPC UA and XML Data Type Mapping. For the purposes of this document, the terms and definitions given in OPC 10000-1, OPC 10000-3, OPC 10000-4, OPC 10000-5, OPC 10000-7, and XML Schema Part 2 apply.
Note that OPC UA terms and terms defined in this document are italicized in the document.
3.2 Abbreviated terms
| OPC | Open Platform Communications |
| XML | Extensible Markup Language |
3.3 Conventions used in this document
3.3.1 Conventions for Node descriptions
3.3.1.1 Node definitions
Node definitions are specified using tables (see Table 2).
Attributes are defined by providing the Attribute name and a value, or a description of the value.
References are defined by providing the ReferenceType name, the BrowseName of the TargetNode and its NodeClass.
If the TargetNode is a component of the Node being defined in the table the Attributes of the composed Node are defined in the same row of the table.
The DataType is only specified for Variables; “[<number>]” indicates a single-dimensional array, for multi-dimensional arrays the expression is repeated for each dimension (e.g. [2][3] for a two-dimensional array). For all arrays the ArrayDimensions is set as identified by <number> values. If no <number> is set, the corresponding dimension is set to 0, indicating an unknown size. If no number is provided at all the ArrayDimensions can be omitted. If no brackets are provided, it identifies a scalar DataType and the ValueRank is set to the corresponding value (see OPC 10000-3). In addition, ArrayDimensions is set to null or is omitted. If it can be Any or ScalarOrOneDimension, the value is put into “{<value>}”, so either “{Any}” or “{ScalarOrOneDimension}” and the ValueRank is set to the corresponding value (see OPC 10000-3) and the ArrayDimensions is set to null or is omitted. Examples are given in Table 1.
| Notation | DataType | ValueRank | ArrayDimensions | Description |
| 0:Int32 | 0:Int32 | -1 | omitted or null | A scalar Int32. |
| 0:Int32[] | 0:Int32 | 1 | omitted or {0} | Single-dimensional array of Int32 with an unknown size. |
| 0:Int32[][] | 0:Int32 | 2 | omitted or {0,0} | Two-dimensional array of Int32 with unknown sizes for both dimensions. |
| 0:Int32[3][] | 0:Int32 | 2 | {3,0} | Two-dimensional array of Int32 with a size of 3 for the first dimension and an unknown size for the second dimension. |
| 0:Int32[5][3] | 0:Int32 | 2 | {5,3} | Two-dimensional array of Int32 with a size of 5 for the first dimension and a size of 3 for the second dimension. |
| 0:Int32{Any} | 0:Int32 | -2 | omitted or null | An Int32 where it is unknown if it is scalar or array with any number of dimensions. |
| 0:Int32{ScalarOrOneDimension} | 0:Int32 | -3 | omitted or null | An Int32 where it is either a single-dimensional array or a scalar. |
The TypeDefinition is specified for Objects and Variables.
The TypeDefinition column specifies a symbolic name for a NodeId, i.e. the specified Node points with a HasTypeDefinition Reference to the corresponding Node.
The ModellingRule of the referenced component is provided by specifying the symbolic name of the rule in the ModellingRule column. In the AddressSpace, the Node shall use a HasModellingRule Reference to point to the corresponding ModellingRule Object.
If the NodeId of a DataType is provided, the symbolic name of the Node representing the DataType shall be used.
Note that if a symbolic name of a different namespace is used, it is prefixed by the NamespaceIndex (see 3.3.2.2).
Nodes of all other NodeClasses cannot be defined in the same table; therefore, only the used ReferenceType, their NodeClass and their BrowseName are specified. A reference to another part of this document points to their definition. Table 2 illustrates the table. If no components are provided, the DataType, TypeDefinition and Other columns may be omitted and only a Comment column is introduced to point to the Node definition.
Each Type Node or well-known Instance Node defined shall have one or more ConformanceUnits defined in 7.1 that require the Node to be in the AddressSpace.
The relations between Nodes and ConformanceUnits are defined at the end of the tables defining Nodes, one row per ConformanceUnit. The ConformanceUnits are reflected in the Category element for the Node definition in the UANodeSet (see OPC 10000-6).
The list of ConformanceUnits in the UANodeSet allows Servers to optimize resource consumption by using a list of supported ConformanceUnits to select a subset of the Nodes in an Information Model.
When a Node is selected in this way, all dependencies implied by the References are also selected.
Dependencies exist if the Node is the source of HasTypeDefinition, HasInterface, HasAddIn or any HierarchicalReference. Dependencies also exist if the Node is the target of a HasSubtype Reference. For Variables and VariableTypes, the value of the DataType Attribute is a dependency. For DataType Nodes, any DataTypes referenced in the DataTypeDefinition Attribute are also dependencies.
For additional details see OPC 10000-5.
| Attribute | Value | ||||
| Attribute name | Attribute value. If it is an optional Attribute that is not set “--” is used. | ||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other |
|---|---|---|---|---|---|
| ReferenceType name | NodeClass of the target Node. | BrowseName of the target Node. | DataType of the referenced Node, only applicable for Variables. | TypeDefinition of the referenced Node, only applicable for Variables and Objects. | Additional characteristics of the TargetNode such as the ModellingRule or AccessLevel. |
| NOTE Notes referencing footnotes of the table content. | |||||
| Conformance Units | |||||
|---|---|---|---|---|---|
| Name of ConformanceUnit, one row per ConformanceUnit |
Components of Nodes can be complex that is containing components by themselves. The TypeDefinition, NodeClass and DataType can be derived from the type definitions, and the symbolic name can be created as defined in 3.3.3.1. Therefore, those containing components are not explicitly specified; they are implicitly specified by the type definitions.
The Other column defines additional characteristics of the Node. Examples of characteristics that can appear in this column are show in Table 3.
| Name | Short Name | Description |
| 0:Mandatory | M | The Node has the Mandatory ModellingRule. |
| 0:Optional | O | The Node has the Optional ModellingRule. |
| 0:MandatoryPlaceholder | MP | The Node has the MandatoryPlaceholder ModellingRule. |
| 0:OptionalPlaceholder | OP | The Node has the OptionalPlaceholder ModellingRule. |
| ReadOnly | RO | The Node AccessLevel has the CurrentRead bit set but not the CurrentWrite bit. |
| ReadWrite | RW | The Node AccessLevel has the CurrentRead and CurrentWrite bits set. |
| WriteOnly | WO | The Node AccessLevel has the CurrentWrite bit set but not the CurrentRead bit. |
If multiple characteristics are defined they are separated by commas. The name or the short name may be used.
3.3.1.2 Additional References
To provide information about additional References, the format as shown in Table 4 is used.
| SourceBrowsePath | Reference Type | Is Forward | TargetBrowsePath |
| SourceBrowsePath is always relative to the TypeDefinition. Multiple elements are defined as separate rows of a nested table. | ReferenceType name | True = forward Reference. | TargetBrowsePath points to another Node, which can be a well-known instance or a TypeDefinition. You can use BrowsePaths here as well, which is either relative to the TypeDefinition or absolute. If absolute, the first entry needs to refer to a type or well-known instance, uniquely identified within a namespace by the BrowseName. |
References can be to any other Node.
3.3.1.3 Additional sub-components
To provide information about sub-components, the format as shown in Table 5 is used.
| BrowsePath | References | NodeClass | BrowseName | DataType | TypeDefinition | Others |
| BrowsePath is always relative to the TypeDefinition. Multiple elements are defined as separate rows of a nested table | NOTE Same as for Table 2 | |||||
3.3.1.4 Additional Attribute values
The type definition table provides columns to specify the values for required Node Attributes for InstanceDeclarations. To provide information about additional Attributes, the format as shown in Table 6 is used.
| BrowsePath | <Attribute name> Attribute |
| BrowsePath is always relative to the TypeDefinition. Multiple elements are defined as separate rows of a nested table | The values of attributes are converted to text by adapting the reversible JSON encoding rules defined in OPC 10000-6. If the JSON encoding of a value is a JSON string or a JSON number then that value is entered in the value field. Double quotes are not included. If the DataType includes a NamespaceIndex (QualifiedNames, NodeIds or ExpandedNodeIds) then the notation used for BrowseNames is used. If the value is an Enumeration the name of the enumeration value is entered. If the value is a Structure then a sequence of name and value pairs is entered. Each pair is followed by a newline. The name is followed by a colon. The names are the names of the fields in the DataTypeDefinition. If the value is an array of non-structures then a sequence of values is entered where each value is followed by a newline. If the value is an array of Structures or a Structure with fields that are arrays or with nested Structures then the complete JSON array or JSON object is entered. Double quotes are not included. |
There can be multiple columns to define more than one Attribute.
3.3.2 NodeIds and BrowseNames
3.3.2.1 NodeIds
The NodeIds of all Nodes described in this standard are only symbolic names. Annex A defines the actual NodeIds.
The symbolic name of each Node defined in this document is its BrowseName, or, when it is part of another Node, the BrowseName of the other Node, a “.”, and the BrowseName of itself. In this case “part of” means that the whole has a HasProperty or HasComponent Reference to its part. Since all Nodes not being part of another Node have a unique name in this document, the symbolic name is unique.
The NamespaceUri for all NodeIds defined in this document is defined in Annex A. The NamespaceIndex for this NamespaceUri is vendor-specific and depends on the position of the NamespaceUri in the server namespace table.
Note that this document not only defines concrete Nodes, but also requires that some Nodes shall be generated, for example one for each Session running on the Server. The NodeIds of those Nodes are Server-specific, including the namespace. But the NamespaceIndex of those Nodes cannot be the NamespaceIndex used for the Nodes defined in this document, because they are not defined by this document but generated by the Server.
3.3.2.2 BrowseNames
The text part of the BrowseNames for all Nodes defined in this document is specified in the tables defining the Nodes. The NamespaceUri for all BrowseNames defined in this document is defined in 8.2.
For InstanceDeclarations of NodeClass Object and Variable that are placeholders (OptionalPlaceholder and MandatoryPlaceholder ModellingRule), the BrowseName and the DisplayName are enclosed in angle brackets (<>) as recommended in OPC 10000-3.
If a BrowseName is not defined by this document, a namespace index prefix is added to the BrowseName (e.g., prefix '0' leading to ‘0:EngineeringUnits’ or prefix '2' leading to ‘2:DeviceRevision’). This is typically necessary if a Property of another specification is overwritten or used in the OPC UA types defined in this document. Table 43 provides a list of namespaces and their indexes as used in this document.
3.3.3 Common Attributes
3.3.3.1 General
The Attributes of Nodes, their DataTypes and descriptions are defined in OPC 10000-3. Attributes not marked as optional are mandatory and shall be provided by a Server. The following tables define if the Attribute value is defined by this document or if it is server-specific.
For all Nodes specified in this document, the Attributes named in Table 7 shall be set as specified in the table.
| Attribute | Value |
| DisplayName | The DisplayName is a LocalizedText. Each Server shall provide the DisplayName identical to the BrowseName of the Node for the LocaleId “en” unless specified differently in the specification. Whether the Server provides translated names for other LocaleIds is server-specific. |
| Description | Optionally a server-specific description is provided. |
| NodeClass | Shall reflect the NodeClass of the Node. |
| NodeId | The NodeId is described by BrowseNames as defined in 3.3.2.1. |
| WriteMask | Optionally the WriteMask Attribute can be provided. If the WriteMask Attribute is provided, it shall set all non-server-specific Attributes to not writable. For example, the Description Attribute may be set to writable since a Server may provide a server-specific description for the Node. The NodeId shall not be writable, because it is defined for each Node in this document. |
| UserWriteMask | Optionally the UserWriteMask Attribute can be provided. The same rules as for the WriteMask Attribute apply. |
| RolePermissions | Optionally server-specific role permissions can be provided. |
| UserRolePermissions | Optionally the role permissions of the current Session can be provided. The value is server-specific and depends on the RolePermissions Attribute (if provided) and the current Session. |
| AccessRestrictions | Optionally server-specific access restrictions can be provided. |
3.3.3.2 Objects
For all Objects specified in this document, the Attributes named in Table 8 shall be set as specified in the Table 8. The definitions for the Attributes can be found in OPC 10000-3.
| Attribute | Value |
| EventNotifier | Whether the Node can be used to subscribe to Events or not is server-specific. |
3.3.3.3 Variables
For all Variables specified in this document, the Attributes named in Table 9 shall be set as specified in the table. The definitions for the Attributes can be found in OPC 10000-3.
| Attribute | Value |
| MinimumSamplingInterval | Optionally, a server-specific minimum sampling interval is provided. |
| AccessLevel | The access level for Variables used for type definitions is server-specific, for all other Variables defined in this document, the access level shall allow reading; other settings are server-specific. |
| UserAccessLevel | The value for the UserAccessLevel Attribute is server-specific. It is assumed that all Variables can be accessed by at least one user. |
| Value | For Variables used as InstanceDeclarations, the value is server-specific; otherwise it shall represent the value described in the text. |
| ArrayDimensions | If the ValueRank does not identify an array of a specific dimension (i.e. ValueRank <= 0) the ArrayDimensions can either be set to null or the Attribute is missing. This behaviour is server-specific. If the ValueRank specifies an array of a specific dimension (i.e. ValueRank > 0) then the ArrayDimensions Attribute shall be specified in the table defining the Variable. |
| Historizing | The value for the Historizing Attribute is server-specific. |
| AccessLevelEx | If the AccessLevelEx Attribute is provided, it shall have the bits 8, 9, and 10 set to 0, meaning that read and write operations on an individual Variable are atomic, and arrays can be partly written. |
3.3.3.4 VariableTypes
For all VariableTypes specified in this document, the Attributes named in Table 10 shall be set as specified in the table. The definitions for the Attributes can be found in OPC 10000-3.
| Attributes | Value |
| Value | Optionally a server-specific default value can be provided. |
| ArrayDimensions | If the ValueRank does not identify an array of a specific dimension (i.e. ValueRank <= 0) the ArrayDimensions can either be set to null or the Attribute is missing. This behaviour is server-specific. If the ValueRank specifies an array of a specific dimension (i.e. ValueRank > 0) then the ArrayDimensions Attribute shall be specified in the table defining the VariableType. |
3.3.3.5 Methods
For all Methods specified in this document, the Attributes named in Table 11 shall be set as specified in the table. The definitions for the Attributes can be found in OPC 10000-3.
| Attributes | Value |
| Executable | All Methods defined in this document shall be executable (Executable Attribute set to “True”), unless it is defined differently in the Method definition. |
| UserExecutable | The value of the UserExecutable Attribute is server-specific. It is assumed that all Methods can be executed by at least one user. |
4 Use cases
This document does not define a complete mapping of an XML Schema to an OPC UA Information Model or from an OPC UA Information Model to XML. Different mapping approaches can be used depending on the concrete use cases for such a mapping.
This document defines the bidirectional mapping of XML built-in data types and OPC UA built-in DataTypes. The mappings defined here can be used as the basis for other use cases, even if the mapping strategies on a higher level are different.
If a simple one-way mapping of OPC UA built-in DataTypes to XML is needed then the XML schema defined in OPC 10000-6 should be used instead of the mapping defined here.
5 Mapping
5.1 Overview
The goal of the mapping is to provide a lossless, bi-directional mapping of built-in data types from OPC UA to XML and vice versa.
In some cases, it is possible to map an OPC UA DataType to an XML data type directly (see 5.2). In most cases, this is a lossless mapping, sometimes there is a loss of precision or information.
In other cases, there is an OPC UA DataType without a corresponding XML data type. For those cases, the XML Schema defined in OPC 10000-6, Annex D, provides appropriate XML data types that can be used. The mapping to those XML data types is defined in 5.3.
Finally, there are cases where there is an XML data type without a corresponding OPC UA DataType. For those cases, an OPC UA Information Model is defined (see 6). The mapping is defined in 5.4.
5.2 Direct Mapping of XML and OPC UA DataTypes
5.2.1 Untitled
In Table 12, the direct mapping of XML data types and OPC UA DataTypes is defined. If there are any restrictions on a lossless, bidirectional mapping, this is described in the Comment column. If this column is empty, there are no restrictions.
| OPC UA DataType | XML DataType | Comment |
| String | string | Implementations might limit the maximum String size. |
| Boolean | boolean | |
| Decimal | decimal | Implementations might limit the maximum Decimal size. |
| Float | float | |
| Double | double | |
| Duration | duration | In this mapping there might be a loss in precision (XML only requires down to minimum fractional second precision of milliseconds, OPC UA based Duration is a double (representing milliseconds). |
| DateTime | dateTime | Many implementations will not be able to represent the full range of DateTime values. To maximize interoperability, the following rules apply: When going from XML to an implementation: If the XML value is <= MinDate then the value is MinDate; If the XML value is >= MaxDate then the value is MaxDate; XML values without a TimezoneOffset are assumed to be in UTC; XML values with a TimezoneOffset are converted to UTC; Fractions of seconds not supported by the implementation are dropped. When going from an implementation to XML: If the value is MinDate the XML is ‘0001-01-01T00:00:00Z’; If the value is MaxDate the XML is ‘9999-12-31T23:59:59Z’; XML values are always in UTC; Fractions of seconds, if supported by the implementation, are included. Where: MinDate is the earliest date supported by an implementation; MaxDate is the latest date supported by an implementation; All implementations are required to support seconds. The value of MinDate is the default value and semantically equivalent to a Null value. |
| UtcTime | dateTimeTimestamp | See limitations of DateTime |
| ByteString | base64Binary | XML has two ByteString representations – hexBinary and base64Binary. The mapping of OPC UA ByteString to XML base64Binary is defined in OPC 10000-6. The mapping to XML hexBinary is defined in section 5.4. Implementations might limit the maximum ByteString size. |
| Int64 | long | |
| Int32 | int | |
| Int16 | short | |
| SByte | byte | |
| UInt64 | unsignedLong | |
| UInt32 | unsignedInt | |
| UInt16 | unsignedShort | |
| Byte | unsignedByte | |
| NormalizedString | normalizedString | Implementations might limit the maximum String size. In OPC UA, limitations on the string are only defined in the specification but not explicitly defined by the data structure, so implementations not following the specification may provide invalid values. |
| LocaleId | language | Both data types are based on strings defined in IETF RFC 5646 and should represent the same format, e.g., “en-US”. OPC UA allows an empty or null string, which is not allowed in XML. In OPC UA, limitations on the string are only defined in the specification but not explicitly defined by the data structure, so implementations not following the specification may provide invalid values. In XML, the schema definition only restricts the allowed values to a certain degree, so implementations not following the specification may provide invalid values. XML only restricts the allowed values to a certain degree in its schema definition, so potentially values could be invalid. |
| UriString | anyURI | Implementations might limit the maximum String size. |
5.3 New XML data types for built-in OPC UA DataTypes
In Table 13, the mapping of built-in OPC UA DataTypes to XML data types is defined, where there is no corresponding built-in XML data type available. An XML Schema defined in OPC 10000-6, Annex D, provides the appropriate XML data types for this mapping.
| OPC UA DataType | XML DataType | Comment |
| DataValue | DataValue | XML data type defined in OPC 10000-6, Annex D |
| DiagnosticInfo | DiagnosticInfo | XML data type defined in OPC 10000-6, Annex D |
| ExpandedNodeId | ExpandedNodeId | XML data type defined in OPC 10000-6, Annex D Contains ServerIndex and potentially NamespaceIndex (both Server-specific) |
| Guid | Guid | XML data type defined in OPC 10000-6, Annex D Does not check specific GUID-format in XML |
| LocalizedText | LocalizedText | XML data type defined in OPC 10000-6, Annex D |
| NodeId | NodeId | XML data type defined in OPC 10000-6, Annex D Contains NamespaceIndex (Server-specific) |
| QualifiedName | QualifiedName | XML data type defined in OPC 10000-6, Annex D Contains NamespaceIndex (Server-specific) |
| StatusCode | StatusCode | XML data type defined in OPC 10000-6, Annex D |
| XmlElement | XmlElement | XML data type defined in OPC 10000-6, Annex D |
5.4 New OPC UA DataTypes for built-in XML data types
In Table 14, the mapping of built-in XML data types to OPC UA DataTypes is defined, where there is no corresponding built-in OPC UA DataType available. Those OPC UA DataTypes are defined in 6. In some cases, the range is smaller than possible in the XML data type.
| OPC UA DataType | XML DataType | Comment |
| XmlQName | QName | Contains XML document specific prefix Implementations might limit the maximum String size. |
| Array of XmlQName | NOTATION | Contains XML document specific prefixes Implementations might limit the maximum String size. |
| XmlToken | token | Implementations might limit the maximum String size. |
| XmlNmToken | NMTOKEN | Implementations might limit the maximum String size. |
| Array of XmlNmToken | NMTOKENS | Implementations might limit the maximum array length. |
| XmlName | Name | Implementations might limit the maximum String size. |
| XmlNcName | NCName | Implementations might limit the maximum String size. |
| XmlId | ID | Implementations might limit the maximum String size. |
| XmlIdRef | IDREF | Implementations might limit the maximum String size. |
| Array of XmlIdRef | IDREFS | Implementations might limit the maximum array length. |
| XmlEntity | ENTITY | Implementations might limit the maximum String size. |
| Array of XmlEntity | ENTITIES | Implementations might limit the maximum array length. |
| XmlInteger | integer | XmlInteger is a subtype of Int64 with a limited max. and min. value, whereas the size of integer is unlimited. |
| XmlNonPositiveInteger | nonPositiveInteger | The min. of XmlNonPositiveInteger is limited to min. of Int64, whereas the min. of nonPositiveInteger is unlimited. |
| XmlNegativeInteger | negativeInteger | The min. of XmlNegativeInteger is limited to min. of Int64, whereas the min. of negativeInteger is unlimited. |
| XmlNonNegativeInteger | nonNegativeInteger | The max. of XmlNonNegativeInteger is limited to max. of UInt64, whereas the max. of nonNegativeInteger is unlimited. |
| XmlPositiveInteger | positiveInteger | The max. of XmlPositiveInteger is limited to max. of UInt64, whereas the max. of positiveInteger is unlimited. |
| XmlHexBinary | hexBinary | Implementations might limit the maximum ByteString size. |
| XmlYearMonthDuration | yearMonthDuration | Implementations might limit the maximum String size. |
| XmlGYearMonth | gYearMonth | Implementations might limit the maximum String size. |
| XmlDayTimeDuration | dayTimeDuration | Implementations might limit the maximum String size. |
| XmlGYear | gYear | Implementations might limit the maximum String size. |
| XmlGMonth | gMonth | Implementations might limit the maximum String size. |
| XmlGDay | gDay | Implementations might limit the maximum String size. |
| XmlGMonthDay | gMonthDay | Implementations might limit the maximum String size. |
| XmlTime | time | Implementations might limit the maximum String size. |
| XmlDate | date | Implementations might limit the maximum String size. |
5.5 Handling of Errors
If the concrete mapping of a data type does not specify more specific error handling rules, the following shall apply:
Return an error when the type conversion fails because of limitations in the destination range. In an OPC UA context, the StatusCode Bad_OutOfRange should be returned (e.g. in the Value of a Variable).
Return an error when an incorrect syntax is encountered. In an OPC UA context, the StatusCode Bad_SyntaxError should be returned (e.g. in the Value of a Variable).”
6 OPC UA Information Model for XML Data Types
6.1 Overview
6.2 XmlQName
This simple DataType is a subtype of String. It contains a string according to the XML data type QName defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 15.
| Attribute | Value | |||||
| BrowseName | XmlQName | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.3 XmlToken
This simple DataType is a subtype of NormalizedString. It contains a string according to the XML data type token defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 16.
| Attribute | Value | |||||
| BrowseName | XmlToken | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:NormalizedString DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.4 XmlNmToken
This simple DataType is a subtype of XmlToken. It contains a string according to the XML data type NMTOKEN defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 17.
| Attribute | Value | |||||
| BrowseName | XmlNmToken | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlToken DataType defined in 6.3 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.5 XmlName
This simple DataType is a subtype of XmlToken. It contains a string according to the XML data type Name defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 18.
| Attribute | Value | |||||
| BrowseName | XmlName | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlToken DataType defined in 6.3 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.6 XmlNcName
This simple DataType is a subtype of XmlName. It contains a string according to the XML data type NCName defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 19.
| Attribute | Value | |||||
| BrowseName | XmlNcName | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlName DataType defined in 6.5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.7 XmlId
This simple DataType is a subtype of XmlNcName. It contains a string according to the XML data type ID defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 20.
| Attribute | Value | |||||
| BrowseName | XmlId | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlNcName DataType defined in 6.6 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.8 XmlIdRef
This simple DataType is a subtype of XmlNcName. It contains a string according to the XML data type IDREF defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 21.
| Attribute | Value | |||||
| BrowseName | XmlIdRef | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlNcName DataType defined in 6.6 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.9 XmlEntity
This simple DataType is a subtype of XmlNcName. It contains a string according to the XML data type ENTITY defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 22.
| Attribute | Value | |||||
| BrowseName | XmlEntity | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlNcName DataType defined in 6.6 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.10 XmlInteger
This simple DataType is a subtype of Int64. It represents integer values according to the XML data type integer defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 23.
| Attribute | Value | |||||
| BrowseName | XmlInteger | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:Int64 DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.11 XmlNonPositiveInteger
This simple DataType is a subtype of XmlInteger. It represents integer values according to the XML data type nonPositiveInteger defined in XML Schema Part 2. It is not allowed to use this DataType with value 1 or larger. Its representation in the AddressSpace is defined in Table 24.
| Attribute | Value | |||||
| BrowseName | XmlNonPositiveInteger | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlInteger DataType defined in 6.10 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.12 XmlNegativeInteger
This simple DataType is a subtype of XmlInteger. It represents integer values according to the XML data type negativeInteger defined in XML Schema Part 2. It is not allowed to use this DataType with value 0 or larger. Its representation in the AddressSpace is defined in Table 25.
| Attribute | Value | |||||
| BrowseName | XmlNegativeInteger | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlInteger DataType defined in 6.10 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.13 XmlNonNegativeInteger
This simple DataType is a subtype of UInt64. It represents integer values according to the XML data type nonNegativeInteger defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 26.
| Attribute | Value | |||||
| BrowseName | XmlNonNegativeInteger | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:UInt64 DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.14 XmlPositiveInteger
This simple DataType is a subtype of UInt64. It represents integer values according to the XML data type positiveInteger defined in XML Schema Part 2. It is not allowed to use this DataType with value 0. Its representation in the AddressSpace is defined in Table 27.
| Attribute | Value | |||||
| BrowseName | XmlPositiveInteger | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the XmlNonNegativeInteger DataType defined in 6.13 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.15 XmlHexBinary
This simple DataType is a subtype of ByteString. It represents a sequence of byte values according to the XML data type hexBinary defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 28.
| Attribute | Value | |||||
| BrowseName | XmlHexBinary | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:ByteString DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.16 XmlYearMonthDuration
This simple DataType is a subtype of String. It contains a string according to the XML data type yearMonthDuration defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 29.
| Attribute | Value | |||||
| BrowseName | XmlYearMonthDuration | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.17 XmlGYearMonth
This simple DataType is a subtype of String. It contains a string according to the XML data type gYearMonth defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 30.
| Attribute | Value | |||||
| BrowseName | XmlGYearMonth | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.18 XmlDayTimeDuration
This simple DataType is a subtype of String. It contains a string according to the XML data type dayTimeDuration defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 31.
| Attribute | Value | |||||
| BrowseName | XmlDayTimeDuration | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.19 XmlGYear
This simple DataType is a subtype of String. It contains a string according to the XML data type gYear defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 32.
| Attribute | Value | |||||
| BrowseName | XmlGYear | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.20 XmlGMonth
This simple DataType is a subtype of String. It contains a string according to the XML data type gMonth defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 33.
| Attribute | Value | |||||
| BrowseName | XmlGMonth | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.21 XmlGDay
This simple DataType is a subtype of String. It contains a string according to the XML data type gDay defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 34.
| Attribute | Value | |||||
| BrowseName | XmlGDay | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.22 XmlGMonthDay
This simple DataType is a subtype of String. It contains a string according to the XML data type gMonthDay defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 35.
| Attribute | Value | |||||
| BrowseName | XmlGMonthDay | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.23 XmlTime
This simple DataType is a subtype of String. It contains a string according to the XML data type time defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 36.
| Attribute | Value | |||||
| BrowseName | XmlTime | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
6.24 XmlDate
This simple DataType is a subtype of String. It contains a string according to the XML data type date defined in XML Schema Part 2. Its representation in the AddressSpace is defined in Table 37.
| Attribute | Value | |||||
| BrowseName | XmlDate | |||||
| IsAbstract | False | |||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Other | |
|---|---|---|---|---|---|---|
| Subtype of the 0:String DataType defined in OPC 10000-5 | ||||||
| Conformance Units | ||||||
|---|---|---|---|---|---|---|
| XML Data Types |
7 Profiles and Conformance Units
7.1 Conformance Units
Table 38 defines the corresponding ConformanceUnits for the OPC UA Information Model representing specific OPC UA DataTypes for built-in XML data types.
| Category | Title | Description |
| Server | XML Data Types | Contains all DataTypes defined in the Information Model for XML Data Types in the AddressSpace and if the DataTypes are used, they are used according to the specification. |
7.2 Profiles
7.2.1 Profile list
Table 39 lists all Profiles defined in this document and defines their URIs.
| Profile | URI |
| XML Data Types Server Facet | http://opcfoundation.org/UA-Profile/XML/Server/DataTypes |
7.2.2 Server Facets
7.2.2.1 Overview
The following sections specify the Facets available for Servers. Each section defines and describes a Facet or Profile.
7.2.2.2 XML Data Types Server Facet
Table 40 defines a Profile that describes the XML Data Types Server Profile.
| Group | Conformance Unit / Profile Title | Mandatory / Optional |
| XML | XML Data Types | M |
7.2.3 Client Facets
This specification does not define any Client Facets.
8 Namespaces
8.1 Namespace Metadata
Table 41 defines the namespace metadata for this document. The Object is used to provide version information for the namespace and an indication about static Nodes. Static Nodes are identical for all Attributes in all Servers, including the Value Attribute. See OPC 10000-5 for more details.
The information is provided as Object of type NamespaceMetadataType. This Object is a component of the Namespaces Object that is part of the Server Object. The NamespaceMetadataType ObjectType and its Properties are defined in OPC 10000-5.
The version information is also provided as part of the ModelTableEntry in the UANodeSet XML file. The UANodeSet XML schema is defined in OPC 10000-6.
| Attribute | Value | ||
| BrowseName | http://opcfoundation.org/UA/XML/ | ||
| Property | DataType | Value | |
|---|---|---|---|
| NamespaceUri | String | http://opcfoundation.org/UA/XML/ | |
| NamespaceVersion | String | 1.0.0 | |
| NamespacePublicationDate | DateTime | 2023-01-14 | |
| IsNamespaceSubset | Boolean | False | |
| StaticNodeIdTypes | IdType[] | 0 | |
| StaticNumericNodeIdRange | NumericRange [] | ||
| StaticStringNodeIdPattern | String | ||
Note: The IsNamespaceSubset Property is set to False as the UANodeSet XML file contains the complete Namespace. Servers only exposing a subset of the Namespace need to change the value to True.
8.2 Handling of OPC UA Namespaces
Namespaces are used by OPC UA to create unique identifiers across different naming authorities. The Attributes NodeId and BrowseName are identifiers. A Node in the UA AddressSpace is unambiguously identified using a NodeId. Unlike NodeIds, the BrowseName cannot be used to unambiguously identify a Node. Different Nodes may have the same BrowseName. They are used to build a browse path between two Nodes or to define a standard Property.
Servers may often choose to use the same namespace for the NodeId and the BrowseName. However, if they want to provide a standard Property, its BrowseName shall have the namespace of the standards body although the namespace of the NodeId reflects something else, for example the EngineeringUnits Property. All NodeIds of Nodes not defined in this document shall not use the standard namespaces.
Table 42 provides a list of mandatory and optional namespaces used in an XML Data Types OPC UA Server.
| NamespaceURI | Description | Use |
| http://opcfoundation.org/UA/ | Namespace for NodeIds and BrowseNames defined in the OPC UA specification. This namespace shall have namespace index 0. | Mandatory |
| Local Server URI | Namespace for nodes defined in the local server. This namespace shall have namespace index 1. | Mandatory |
| http://opcfoundation.org/UA/XML/ | Namespace for NodeIds and BrowseNames defined in this document. The namespace index is Server specific. | Mandatory |
| Vendor specific types | A Server may provide vendor-specific types like types derived from ObjectTypes defined in this document in a vendor-specific namespace. | Optional |
| Vendor specific instances | A Server provides vendor-specific instances of the standard types or vendor-specific instances of vendor-specific types in a vendor-specific namespace. It is recommended to separate vendor specific types and vendor specific instances into two or more namespaces. | Mandatory |
Table 43 provides a list of namespaces and their index used for BrowseNames in this document. The default namespace of this document is not listed since all BrowseNames without prefix use this default namespace.
| NamespaceURI | Namespace Index | Example |
| http://opcfoundation.org/UA/ | 0 | 0:String |
Annex A Information Model for XML Data Types Namespace and mappings (Normative)
A.1 NodeSet and Supplementary Files for XML Data Types Information Model
The XML Data Types Information Model is identified by the following URI:
http://opcfoundation.org/UA/XML/
Documentation for the NamespaceUri can be found here.
The NodeSet associated with this version of specification can be found here:
https://reference.opcfoundation.org/nodesets/?u=http://opcfoundation.org/UA/XML/&v=1.0.0&ns=1
The NodeSet associated with the latest version of the specification can be found here:
https://reference.opcfoundation.org/nodesets/?u=http://opcfoundation.org/UA/XML/&ns=1
The supplementary files associated with this version of specification can be found here:
https://reference.opcfoundation.org/nodesets/?u=http://opcfoundation.org/UA/XML/&v=1.0.0&i=2
The supplementary files associated with the latest version of the specification can be found here:
https://reference.opcfoundation.org/nodesets/?u= http://opcfoundation.org/UA/XML/
_____________
Agreement of Use
COPYRIGHT RESTRICTIONS
This document is provided "as is" by the OPC Foundation.
Right of use for this specification is restricted to this specification and does not grant rights of use for referred documents.
Right of use for this specification will be granted without cost.
This document may be distributed through computer systems, printed or copied as long as the content remains unchanged and the document is not modified.
OPC Foundation does not guarantee usability for any purpose and shall not be made liable for any case using the content of this document.
The user of the document agrees to indemnify OPC Foundation and its officers, directors and agents harmless from all demands, claims, actions, losses, damages (including damages from personal injuries), costs and expenses (including attorneys' fees) which are in any way related to activities associated with its use of content from this specification.
The document shall not be used in conjunction with company advertising, shall not be sold or licensed to any party.
The intellectual property and copyright is solely owned by the OPC Foundation.
PATENTS
The attention of adopters is directed to the possibility that compliance with or adoption of OPC specifications may require use of an invention covered by patent rights. OPC Foundation shall not be responsible for identifying patents for which a license may be required by any OPC specification, or for conducting legal inquiries into the legal validity or scope of those patents that are brought to its attention. OPC specifications are prospective and advisory only. Prospective users are responsible for protecting themselves against liability for infringement of patents.
WARRANTY AND LIABILITY DISCLAIMERS
WHILE THIS PUBLICATION IS BELIEVED TO BE ACCURATE, IT IS PROVIDED "AS IS" AND MAY CONTAIN ERRORS OR MISPRINTS. THE OPC FOUDATION MAKES NO WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, WITH REGARD TO THIS PUBLICATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF TITLE OR OWNERSHIP, IMPLIED WARRANTY OF MERCHANTABILITY OR WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE. IN NO EVENT SHALL THE OPC FOUNDATION BE LIABLE FOR ERRORS CONTAINED HEREIN OR FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, RELIANCE OR COVER DAMAGES, INCLUDING LOSS OF PROFITS, REVENUE, DATA OR USE, INCURRED BY ANY USER OR ANY THIRD PARTY IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS MATERIAL, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
The entire risk as to the quality and performance of software developed using this specification is borne by you.
RESTRICTED RIGHTS LEGEND
This Specification is provided with Restricted Rights. Use, duplication or disclosure by the U.S. government is subject to restrictions as set forth in (a) this Agreement pursuant to DFARs 227.7202-3(a); (b) subparagraph (c)(1)(i) of the Rights in Technical Data and Computer Software clause at DFARs 252.227-7013; or (c) the Commercial Computer Software Restricted Rights clause at FAR 52.227-19 subdivision (c)(1) and (2), as applicable. Contractor / manufacturer are the OPC Foundation, 16101 N. 82nd Street, Suite 3B, Scottsdale, AZ, 85260-1830.
COMPLIANCE
The OPC Foundation shall at all times be the sole entity that may authorize developers, suppliers and sellers of hardware and software to use certification marks, trademarks or other special designations to indicate compliance with these materials as specified within this document. Products developed using this specification may claim compliance or conformance with this specification if and only if the software satisfactorily meets the certification requirements set by the OPC Foundation. Products that do not meet these requirements may claim only that the product was based on this specification and must not claim compliance or conformance with this specification.
Trademarks
Most computer and software brand names have trademarks or registered trademarks. The individual trademarks have not been listed here.
GENERAL PROVISIONS
Should any provision of this Agreement be held to be void, invalid, unenforceable or illegal by a court, the validity and enforceability of the other provisions shall not be affected thereby.
This Agreement shall be governed by and construed under the laws of Germany.
This Agreement embodies the entire understanding between the parties with respect to, and supersedes any prior understanding or agreement (oral or written) relating to, this specification.