

12:57, EEST

August 5, 2025

I am trying `NodeManagerUaNode.toNodeSet()`, and when I later want to validate the generated XML against `UANodeset.xsd` schema, I get the following error:
“If the ‘nillable’ attribute is false in the schema, the ‘xsi:nil’ attribute must not be present in the instance.” at this line:
uax:String xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:nil=”true”
Here’s some context for that XML line:
(well.. I couldn’t add it because apparently the greater than and smaller than characters get deleted, and I cannot find any markup reference for the forum)
13:44, EEST

Moderators
February 11, 2020

Hello,
Can you send your NodeSet to jsdk-support@prosysopc.com so that we can investigate it?
19:06, EEST

August 5, 2025

15:26, EEST

April 3, 2012

The default value when a node is created with the SDK should be that there is no value (unless the VariableType had something) and thus that would not be written at all to the XML, though this is a relatively new feature. So basically for this to happen you must set a variant that has a string array and an element of this array must be null.
Technically Values are outside of the https://github.com/OPCFoundati…..odeSet.xsd, they are processContents=”lax” and can contain anything. The XML encoding of contents of Values is defined in the OPC UA Specification rules, not “by XML” (though it must be valid xml to be parsed). It is unlikely that namespaces defininmg custom Structure schemas would be available (SDK also doesn’t know them, it assumes they are the namespace+”Types.xsd when it writes the nodeset file”), thus in general I’m unsure how much sense it makes to try to validate the contents of Value tags by XML-means alone, it might not work as a general concept.
That being said, for the core types there is https://github.com/OPCFoundati……Types.xsd, which we do refer since that is what other NodeSets do. If we are pendantic, the ListOfString complex type defining the string-elements do not mark the elements itself as nillable, just the whole ListOfString element is. However, that does contradict what the spec text days https://reference.opcfoundatio…..docs/5.3.4 “The nillable attribute shall be specified because XML encoders will drop elements in arrays if those elements are empty.”. Now then, to me that “…XML encoders…” part looks a bit odd to me (at least we have no such limitation, though XML-writing basically doesn’t exist OPC UA -wise since the SOAP-version was deprecated ages ago), but regardless it does say the nillable attribute shall be specified. For most (UA-nullable) types that is the case in the schema, so it can be that it is a typo for the ListOfString. We might need to ask the OPC Foundation which way it goes.
The specification also has this general rule on empty-vs-null-vs-zero-length https://reference.opcfoundatio…..ocs/5.1.11, so in theory it could also mean that String in XML doesn’t have a null encoding. However ListOfByteString does have in the Opc.Ua.Types.xsd nillable elements and in general String and ByteString have much analogy.
Though, seems we would put nil for OPC UA types that do not have a null encoding, so there is at least that much bug that we need to fix in a future version.
15:46, EEST

August 5, 2025

15:49, EEST

April 3, 2012

17:35, EEST

September 18, 2025

10:14, EEST

April 3, 2012

We have a beta build that should fix the issue, please send mail to jsdk-support@prosysopc.com (and refer this forum chain) if you wish to try.
It will be in the next release which I hope will happen during this month.
