Skip to content

Commit

Permalink
cleaner language
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Jan 16, 2025
1 parent f3a1ff7 commit 63b77ca
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions nxdl.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -968,30 +968,38 @@ https://stackoverflow.com/a/48980995/1046449 -->
in the inheritance hierarchy this field is derived from.

This attribute is to be used in cases where there is an ambiguity
in the inheritance. An example are the ``AXISNAME`` and ``DATA``
fields in ``NXdata``, which are both of type ``NX_NUMBER``.
Thus, when specializing ``NXdata`` in an application definition,
``extends`` attribute allows to specify whether a field in the
specialized ``NXdata`` is an ``AXISNAME`` and ``DATA``.
in the inheritance. At the moment, this is only the case for the
``AXISNAME`` and ``DATA`` fields in ``NXdata``, which are both of
type ``NX_NUMBER``. Thus, when specializing ``NXdata`` in an application
definition, the ``extends`` attribute allows to specify whether a field
in the specialized ``NXdata`` is an ``AXISNAME`` and ``DATA``.

For example, consider the following NXDL snippet:

<definition xmlns="http://definition.nexusformat.org/nxdl/3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" category="application" name="NXiv_temp" extends="NXsensor_scan" type="group" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<doc>
Application definition for temperature-dependent IV curve measurements.
</doc>
<group type="NXentry">
<group type="NXdata">
<doc>
This NXdata contains multiple fields. Temperature and voltage are supposed to specialize `AXISNAME`, whereas
`current` is specializing `DATA`.
</doc>
<field name="temperature" type="NX_NUMBER" extends="/NXdata/AXISNAME"/>
<field name="voltage" type="NX_NUMBER" extends="/NXdata/AXISNAME"/>
<field name="current" type="NX_NUMBER" extends="/NXdata/DATA"/>
.. code-block:: xml

<definition xmlns="http://definition.nexusformat.org/nxdl/3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
category="application"
name="NXexample"
extends="NXobject"
type="group"
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<doc>
Example application definition.
</doc>
<group type="NXentry">
<group type="NXdata">
<doc>
This NXdata contains multiple fields. Temperature and voltage are supposed to specialize `AXISNAME`, whereas
`current` is specializing `DATA`.
</doc>
<field name="temperature" type="NX_NUMBER" extends="/NXdata/AXISNAME"/>
<field name="voltage" type="NX_NUMBER" extends="/NXdata/AXISNAME"/>
<field name="current" type="NX_NUMBER" extends="/NXdata/DATA"/>
</group>
</group>
</group>
</definition>
</definition>

Here, the ``extends`` attribute is used to specify that the ``temperature`` and ``voltage`` fields are specializations
of the ``AXISNAME`` field, whereas the ``current`` field is a specialization of the ``DATA`` field.
Expand Down

0 comments on commit 63b77ca

Please sign in to comment.