View Issue Details

IDProjectCategoryView StatusLast Update
000739310000-006: MappingsSpecpublic2024-02-06 17:38
ReporterMartin Regen Assigned ToRandy Armstrong  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionreopened 
Product Version1.04 
Target Version1.05Fixed in Version1.05.04 RC1 
Summary0007393: Is there a missing type XMLElement in Opc.Ua.Types.xsd?
Description

https://files.opcfoundation.org/schemas/UA/1.04/Opc.Ua.Types.xsd

The types schema causes an error when compiled with .NET Standard, assuming the definition file Opc.Ua.Types.xsd is per se incorrect:

Type 'http://opcfoundation.org/UA/2008/02/Types.xsd:XmlElement' is not declared.

Steps To Reproduce

Run this test case in UA.NETStandard:

 LoadAllServerDataTypeSystems(i=92)
Source: ClientTest.cs line 607
Duration: 716 ms

Message:
System.Xml.Schema.XmlSchemaException : Type 'http://opcfoundation.org/UA/2008/02/Types.xsd:XmlElement' is not declared.

Standard Output:
Found 2 references
ReadDictionary Opc.Ua i=8252
ReadDictionary TestData ns=3;i=11441
System.Xml.Schema.XmlSchemaException: Type 'http://opcfoundation.org/UA/2008/02/Types.xsd:XmlElement' is not declared.
at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e)
at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)
at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe)
at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo)
at System.Xml.Schema.XmlSchemaSet.Compile()
at Opc.Ua.Schema.Xml.XmlSchemaValidator.Validate(Stream stream) in
\UA-.NETStandard\Stack\Opc.Ua.Core\Types\Schemas\XmlSchemaValidator.cs:line 108
at Opc.Ua.Client.DataDictionary.<Validate>d33.MoveNext() in \UA-.NETStandard\Libraries\Opc.Ua.Client\DataDictionary.cs:line 292
System.Xml.Schema.XmlSchemaException: Type 'http://opcfoundation.org/UA/2008/02/Types.xsd:XmlElement' is not declared.
at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e)
at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)
at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe)
at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo)
at System.Xml.Schema.XmlSchemaSet.Compile()
at Opc.Ua.Schema.Xml.XmlSchemaValidator.Validate(Stream stream) in
\UA-.NETStandard\Stack\Opc.Ua.Core\Types\Schemas\XmlSchemaValidator.cs:line 108
at Opc.Ua.Client.DataDictionary.<Validate>d
33.MoveNext() in \UA-.NETStandard\Libraries\Opc.Ua.Client\DataDictionary.cs:line 292

TagsNo tags attached.
Commit Version1.05.04 RC
Fix Due Date2024-02-01

Activities

Randy Armstrong

2022-01-19 06:41

administrator   ~0015772

How was the schema created? It does not appear to have been created by the ModelCompiler because it does NOT define XmlElement because it is not possible to define a complexType that does what is needed:
Instead it generates elements with xs:any body:

<xs:complexType name="Vector">
<xs:sequence>
<xs:element name="X" type="xs:double" minOccurs="0" />
<xs:element name="Y" type="xs:double" minOccurs="0" />
<xs:element name="Z" type="xs:double" minOccurs="0" />
<xs:element name="A" minOccurs="0" nillable="true">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" processContents="lax" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="Vector" type="tns:Vector" />

Martin Regen

2022-01-22 21:52

developer   ~0015826

Hi Randy, its a xsd created by Modelcompiler. Looks like the types.xsd is ok, but the compiled model has an issue.
I have only one idea that this artifact causes the schema compile to fail?

  &lt;xs:element name=&quot;XmlElementDataType&quot; type=&quot;ua:XmlElement&quot; />

https://github.com/OPCFoundation/UA-.NETStandard/blob/33ae73654ca4054f0c1d7dad10fab14127cd776f/Applications/Quickstarts.Servers/TestData/TestData.Types.xsd#L126

The code was compiled with Modelcompiler quite recently.

Randy Armstrong

2023-11-16 20:33

administrator   ~0020375

Do not create simple datatypes with XmlElement.

Randy Armstrong

2023-11-21 16:08

administrator   ~0020387

Move to Part 6 to add restrictions.

Randy Armstrong

2024-02-04 03:24

administrator   ~0020764

A sequence of Unicode characters that is an XML element.
This built-in type shall not have subtypes.
This built-in is deprecated.
XML data should be passed in a ByteString.

Jim Luth

2024-02-06 17:38

administrator   ~0020775

Agreed to changes edited in web meeting.

Issue History

Date Modified Username Field Change
2021-11-09 17:11 Martin Regen New Issue
2021-11-09 17:13 Martin Regen Steps to Reproduce Updated
2021-11-23 17:54 Jim Luth Assigned To => Randy Armstrong
2021-11-23 17:54 Jim Luth Status new => assigned
2021-11-23 17:54 Jim Luth Project 10000-005: Information Model => NodeSets, XSDs and Generated Code
2021-11-23 17:54 Jim Luth Category Spec => Api Change
2022-01-19 06:41 Randy Armstrong Status assigned => feedback
2022-01-19 06:41 Randy Armstrong Note Added: 0015772
2022-01-22 21:52 Martin Regen Note Added: 0015826
2022-01-22 21:52 Martin Regen Status feedback => assigned
2023-11-16 20:33 Randy Armstrong Status assigned => resolved
2023-11-16 20:33 Randy Armstrong Resolution open => won't fix
2023-11-16 20:33 Randy Armstrong Note Added: 0020375
2023-11-21 16:08 Randy Armstrong Status resolved => feedback
2023-11-21 16:08 Randy Armstrong Resolution won't fix => reopened
2023-11-21 16:08 Randy Armstrong Note Added: 0020387
2023-11-21 16:08 Randy Armstrong Project NodeSets, XSDs and Generated Code => 10000-006: Mappings
2024-01-02 16:58 Jim Luth Status feedback => assigned
2024-01-02 16:58 Jim Luth Category Api Change => Spec
2024-01-02 16:58 Jim Luth Commit Version => 1.05.04 RC
2024-01-02 16:58 Jim Luth Fix Due Date => 2024-02-01
2024-02-04 03:24 Randy Armstrong Status assigned => resolved
2024-02-04 03:24 Randy Armstrong Fixed in Version => 1.05.04 RC1
2024-02-04 03:24 Randy Armstrong Note Added: 0020764
2024-02-06 17:38 Jim Luth Status resolved => closed
2024-02-06 17:38 Jim Luth Note Added: 0020775