Skip to content

Commit

Permalink
Fixes #!45
Browse files Browse the repository at this point in the history
  • Loading branch information
randy-armstrong committed Jan 9, 2024
1 parent 9219ae2 commit 80302ba
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Opc.Ua.ModelCompiler/NodeSetToModelDesign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ private static Namespace CreateNamespace(ModelTableEntry model)
PublicationDate = model.PublicationDate.ToString("yyyy-MM-ddT00:00:00Z"),
Version = model.Version
};
ns.XmlPrefix = ns.Name;
ns.Name = ns.Name.Replace(".", " ");
ns.XmlPrefix = ns.Prefix = ns.Name;
ns.Name = ns.Name.Replace(".", "");
}

if (ns.Value == Namespaces.OpcUa)
Expand Down Expand Up @@ -1181,6 +1181,7 @@ private NodeDesign ImportNode(NodeSet.UANode input)

output.SymbolicId = m_symbolicIds[input.NodeId];
output.SymbolicName = ImportSymbolicName(input);
output.Extensions = input.Extensions;

if (input is UAType)
{
Expand Down
26 changes: 26 additions & 0 deletions Opc.Ua.ModelCompiler/UA Model Design.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public partial class ModelDesign {

private NodeDesign[] itemsField;

private System.Xml.XmlElement[] extensionsField;

private string targetNamespaceField;

private string targetVersionField;
Expand Down Expand Up @@ -91,6 +93,17 @@ public NodeDesign[] Items {
}
}

/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public System.Xml.XmlElement[] Extensions {
get {
return this.extensionsField;
}
set {
this.extensionsField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string TargetNamespace {
Expand Down Expand Up @@ -932,6 +945,8 @@ public partial class NodeDesign {

private bool defaultAccessRestrictionsFieldSpecified;

private System.Xml.XmlElement[] extensionsField;

private System.Xml.XmlQualifiedName symbolicNameField;

private System.Xml.XmlQualifiedName symbolicIdField;
Expand Down Expand Up @@ -1082,6 +1097,17 @@ public bool DefaultAccessRestrictionsSpecified {
}
}

/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public System.Xml.XmlElement[] Extensions {
get {
return this.extensionsField;
}
set {
this.extensionsField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public System.Xml.XmlQualifiedName SymbolicName {
Expand Down
14 changes: 14 additions & 0 deletions Opc.Ua.ModelCompiler/UA Model Design.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<xs:element name="Dictionary" type="DictionaryDesign" minOccurs="0" />
<xs:element name="View" type="ViewDesign" minOccurs="0" />
</xs:choice>
<xs:element name="Extensions" type="ListOfExtensions" minOccurs="0" />
</xs:sequence>
<xs:attribute name="TargetNamespace" type="xs:string" use="required" />
<xs:attribute name="TargetVersion" type="xs:string" use="optional" />
Expand Down Expand Up @@ -148,6 +149,18 @@
</xs:simpleContent>
</xs:complexType>

<xs:complexType name="ListOfExtensions">
<xs:sequence>
<xs:element name="Extension" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" processContents="lax" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:simpleType name="ReleaseStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="Released" />
Expand Down Expand Up @@ -250,6 +263,7 @@
</xs:element>
<xs:element name="AccessRestrictions" type="AccessRestrictions" minOccurs="0" />
<xs:element name="DefaultAccessRestrictions" type="AccessRestrictions" minOccurs="0" />
<xs:element name="Extensions" type="ListOfExtensions" minOccurs="0" />
</xs:sequence>
<xs:attribute name="SymbolicName" type="xs:QName" use="optional">
<xs:annotation>
Expand Down

0 comments on commit 80302ba

Please sign in to comment.