NXDL Rules: The XML Schema files : nxdl_schema
#
Read the NeXus XML Schema
source code documentation#
Read the NeXus XML Schema
|
Default values for all NXDL as defined by the |
|
useful optimization for classes |
|
reference an xml_node in the catalog: |
|
return closest XML ancestor node with a |
return the NeXus XML namespace dictionary |
The NXDL_item_catalog.definition_element
will provide the
defaults for the definition, group, field, link, and symbols
NXDL structures. These internal structures are used:
|
content from the NeXus XML Schema ( |
node matches XPath query: |
|
node matches XPath query: |
|
node matches XPath query: |
|
a complete description of a specific NXDL xs:element node |
|
node matches XPath query: |
|
node matches XPath query: |
Note there is a recursion within NXDL_schema__group
since a group may contain a child group.
- class punx.nxdl_schema.NXDL_Summary(nxdl_xsd_file_name)[source]#
Default values for all NXDL as defined by the
nxdl.xsd
.Provide an easy interface to the default values defined in the XML Schema for the NXDL language.
USAGE:
summary = NXDL_Summary(nxdl_xsd_file_name) ... summary.simpleType['validItemName'].patterns
- class punx.nxdl_schema.NXDL_item_catalog(nxdl_file_name)[source]#
content from the NeXus XML Schema (
nxdl.xsd
)EXAMPLE:
nxdl_xsd_file_name = os.path.join(‘cache’, ‘v3.2’,’nxdl.xsd’) catalog = NXDL_item_catalog(nxdl_xsd_file_name) definition = catalog.definition_element
- class punx.nxdl_schema.NXDL_schema__attribute[source]#
node matches XPath query:
//xs:attribute
xml_node is
xs:attribute
a complete description of a specific NXDL attribute element
NOTES ON ATTRIBUTES
In nxdl.xsd, “attributeType” is used by fieldType and groupGroup to define the NXDL “attribute” element used in fields and groups, respectively. It is not necessary for this code to parse “attributeType” from the rules.
Each of these XML complexType elements defines its own set of attributes and defaults for use in corresponding NXDL components:
attributeType
basicComponent
definitionType
enumerationType
fieldType
groupType
linkType
There is also an “xs:attributeGroup” which may appear as a sibling to any
xs:attribute
element. Thexs:attributeGroup
provides a list of additionalxs:attribute
elements to add to the list. This is the only one known at this time (2017-01-08):deprecatedAttributeGroup
When the content under
xs:complexType
is described within anxs:complexContent/xs:extension
element, thexs:extension
element has abase
attribute which names axs:complexType
element to use as a starting point (like a superclass) for the additional content described within thexs:extension
element.The content may be found at any of these nodes under the parent XML element. Parse them in the order shown:
xs:complexContent/xs:extension/xs:attribute
xs:attribute
(
xs:attributeGroup/
)``xs:attribute``
This will get picked up when parsing the
xs:sequence/xs:element
.xs:sequence/xs:element/xs:complexType/xs:attribute
(
The XPath query for
//xs:attribute
from the root node will pick up all of these. It will be necessary to walk through the parent nodes to determine where each should be applied.
- class punx.nxdl_schema.NXDL_schema__attributeGroup[source]#
node matches XPath query:
/xs:schema/xs:attributeGroup
xml_node is
xs:attributeGroup
- class punx.nxdl_schema.NXDL_schema__complexType[source]#
node matches XPath query:
/xs:schema/xs:complexType
xml_node is
xs:complexType
- class punx.nxdl_schema.NXDL_schema__element[source]#
a complete description of a specific NXDL xs:element node
- class punx.nxdl_schema.NXDL_schema__group[source]#
node matches XPath query:
//xs:group
xml_node is
xs:group
- class punx.nxdl_schema.NXDL_schema_named_simpleType[source]#
node matches XPath query:
/xs:schema/xs:simpleType
xml_node is
xs:simpleType
- punx.nxdl_schema.get_named_parent_node(xml_node)[source]#
return closest XML ancestor node with a
name
attribute or the schema node