-
Notifications
You must be signed in to change notification settings - Fork 65
add target attribute to NXobject using new field super-type
#1558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
As described in a previous comment, the NeXus NXDL is a a set of XML specifications, each of which adhere to an XML Schema ( If NeXus is to continue use of Line 607 in 2aede96
|
|
FWIW: I've been adding the While the NeXus standard defines |
Am I missing something on how XSD works? To my understanding, with in an nxdl.xml file afterwards (this is what's described e.g. here: https://www.w3schools.com/xml/schema_simple_attributes.asp). However, with that you don't define everywhere. You still need to define that attribute within some NXDL file to state that any field can have a Am I missing something about how XSD works in this case? Or is the second case just convention (from the documentation) and not explicitly defined through the XSD file. If so, why not add it explicitly to |
|
Recently, some have found it interesting to add to the In my opinion, these additions contribute towards your confusion. Again, the standard is based on the XML Schema. Also, I agree that XML Schema is not particularly easy to read or write. To develop nxdl.xsd and the NXDL files, we (the NeXus developer team) used editors (such as oXygen XML) that are aware of the rules for XML Schema and for applying them to the XML files that use them. |
I don't think that necessarily is the thing that confuses me. These additions (one of which came from me, by the way) were made exactly for the same reason why I made this PR: to define groups/fields/attributes that can be used in every group (as every group inherits from What I wanted to achieve through this PR is similar: to define what it means to have the
My confusion is exactly in the last two sentences here. I just don't understand how that can be achieved through the XML Schema (i.e., the What would help me greatly is how to understand why by adding it to the XSD, the latter case is achieved and why I don't need to define in the NXDL files anymore (which is what you are saying, if I understand you correctly). Could you clarify: does the XSD actually define the NeXus |
Follow up to #1410.
This is an initial draft for how attributes that are always allowed could be added. The idea is that a new generic field (with the new super-dtype
NX_DTYPE) is added toNXobjectthat contains these default attributes.For now, only the attribute
@targetwas added (see comparable discussion in #1410).In general, I believe the issue is a bit bigger. The
nxdl.xsdfile defines multiple<xs:attribute>for thefieldType(likeunits,long_name,signal). However, some of these are used as XML attributes (i.e., writing something likeThen again, some other of these attributes are (to my understanding) to be used like this
This may be due to me misunderstanding XML design, but I think with the definitions in the nxdl.xd file only the first use case (as XML attributes) is defined, whereas the second use case is not. To illustrate, this passes the schema validation:
I think this is not intended and rather these attributes should be defined somewhere else as attributes that each field can have. The mechanism given in this PR using a generic field in
NXobjectwould be one way to define these.