Question about XML-encoded QualifiedName | OPC UA Standard | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Question about XML-encoded QualifiedName
Avatar
vla
Member
Members
Forum Posts: 8
Member Since:
07/06/2017
sp_UserOfflineSmall Offline
1
10/16/2017 - 13:50
sp_Permalink sp_Print

Hi,

We have a question about the encoding of fields that are of type QualifiedName, for instance the BrowseName of a node. We understand that there are several encodings :

    When the BrowseName is XML encoded, it has the following structure, as per specification 1.03 Part 4 §5.3.1.14 :

<xs:complexType name=”QualifiedName”>

<xs:sequence>

<xs:element name=”NamespaceIndex” type=”xs:int” minOccurs=”0″ />

 <xs:element name=”Name” type=”xs:string” minOccurs=”0″ />

</xs:sequence> </xs:complexType>

which is coherent with what is found in Opc.Ua.Types.bsd.xml

<opc:StructuredType Name=”QualifiedName”>

<opc:Documentation>A string qualified with a namespace index.</opc:Documentation>

<opc:Field Name=”NamespaceIndex” TypeName=”opc:Int32″ />

<opc:Field Name=”Name” TypeName=”opc:CharArray” />

</opc:StructuredType>

    When the BrowseName is described in the node sets xml (e.g. Opc.Ua.NodeSet2.xml), the BrowseName is a simple string, as described by the UANodeSet.xsd : <xs:simpleType name=”QualifiedName”> <xs:restriction base=”xs:string”></xs:restriction> </xs:simpleType> which is understandable, as the BrowseName is an attribute. However, in specification 1.03 Part 6 Annex F.3, it is said that “[the BrowseName is] a QualifiedName serialized as a String with the form: <namespace index>:<name> Where the NamespaceIndex refers to the NamespaceUris table.”. This form tends to make the colon mandatory. The colon is not present in Opc.Ua.NodeSet2.xml.

The questions are:

    Did we correctly identified how a QualifiedName is encoded?
    Why are there two encoded forms for QualifiedNames?
    Is there some specification that defines QualifiedNames with optional colon?

Thanks, Best regards,

Avatar
zbynekz
Member
Members
Forum Posts: 18
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
2
10/17/2017 - 00:56
sp_Permalink sp_Print

I am sure others will have more qualified replies here to help you out, but AFAIK, you have it right. The “encoding” is really just the first form; the other (nodeset) does not appear in OPC UA “runtime” anywhere. And the reasons might be historical or simply an overlook.

Thinking about it, however, some more observations came to my mind:

– I am not aware of any limitation to the name part of the QualifiedName other than it should not exceed 512 characters. If so, even the name itself can start with a number and a colon. That would bring ambiguity in the syntax used in the nodeset, if the index and colon are treated as optional. Because “1:MyName” could then either denote a NamespaceIndex=1 and Name=”MyName”, or NamespaceIndex=0 and Name=”1:MyName”.

– I do not see the spec saying that the name part shall not be empty, which would be a reasonable restriction.

Avatar
Randy Armstrong
Admin
Forum Posts: 28
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
3
10/17/2017 - 07:28
sp_Permalink sp_Print

The UANodeSet is a specialized import/export format which is not used in any over the wire communication between applications.

The UA XML encoding are rules used by UA apps to communicate using XML messages.

The BrowseName text is “Unicode character string that should exclude control characters that are not whitespaces.”.

The UANodeSet format presumes that the OPC-F (i.e. namespace 0) would never define a BrowseName starting with a number and a colon. Other information models can do this because the index prefix must always be there so 1:1:X would be the BrowseName “1:X” in Namespace 1.

A blank BrowseName in NS0 is defined to be a NULL BrowseName.

Other namespaces could blank BrowseNames them but it does not make sense.  

Avatar
vla
Member
Members
Forum Posts: 8
Member Since:
07/06/2017
sp_UserOfflineSmall Offline
4
11/07/2017 - 02:34
sp_Permalink sp_Print

Hi,
Thanks for your responses.
Could you point us toward the spec section that contains “Unicode character string that should exclude control characters that are not whitespaces.” ?
Are the “control characters” defined somewhere ?
When you say:
The UANodeSet format presumes that the OPC-F (i.e. namespace 0) would never define a BrowseName starting with a number and a colon.
Is this taken from the spec ?
Many thanks,
Best regards,

Avatar
Randy Armstrong
Admin
Forum Posts: 28
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
5
11/10/2017 - 08:26
sp_Permalink sp_Print

Part 3 defines the BrowseName type.

The OPC-F controls all NS0 names and the WGs, by convention, will not define a BrowseName starting with a number and ‘:’. 

Other groups working with non-NS0 models have no such restriction.

Forum Timezone: America/Phoenix

Most Users Ever Online: 58

Currently Online:
19 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

mokamadkipli10@gmail.com: 32

ashutoshweb3@gmail.com: 30

Rod Stein: 25

saurabhdeshpande49@gmail.com: 25

sambasiva.a@siemens.com: 24

Martin Lang: 22

Randy Armstrong (Sparhawk): 20

paul.hunkar@opcfoundation.org: 19

zbynekz: 18

fred.loveless@kepware.com: 11

Newest Members:

leixu2@gc.omron.com

blanchehnng3110@tutorkwang.com

yoshinori.fujita.du@oval.co.jp

nkalyanc@hotmail.com

murilosilveirarocha@gmail.com

yatindra.kamath@schneider-electric.com

anette@c.unisexjewelry.org

michael@vernetzen.com.au

tyu86482192@gmail.com

abrmacarde@hotmail.com

Forum Stats:

Groups: 2

Forums: 9

Topics: 300

Posts: 841

 

Member Stats:

Guest Posters: 0

Members: 57611

Moderators: 8

Admins: 3

Administrators: michael.bryant@opcfoundation.org, thomas.burke@opcfoundation.org, Randy Armstrong

Moderators: matthias.damm@ascolab.com, s.hoppe@beckhoff.com, paul.hunkar@dsinteroperability.com, jouni.aro@prosys.fi, tim.fortin@honeywell.com, Jim.Luth@Schneider-Electric.com, Karl-Heinz Deiretsbacher, stefan.hoppe@opcfoundation.org