Skip to content

Commit

Permalink
#619 documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed May 10, 2018
1 parent 5654173 commit ebf42b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nxdl.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@
defined by the parent ``choice`` element
so do not specify the ``@name`` attribute of
the group here.
<!-- TODO: How to enforce in this schema? -->
</xs:documentation>
<!-- TODO: How to enforce the name rule in the schema? -->
</xs:annotation>
</xs:element>
</xs:sequence>
Expand Down
12 changes: 11 additions & 1 deletion utils/nxdl_desc2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@
:ref:`NXDL.data.type.fieldType`
''',

'choice': '''
A ``choice`` element is used when a named group might take one
of several possible NeXus base classes. Logically, it must
have at least two group children.
For more details, see:
:ref:`NXDL.data.type.choiceType`
''',

'group': '''
A ``group`` element can *only* be a child of a
``definition`` or ``group`` element.
Expand Down Expand Up @@ -323,7 +332,7 @@ def applyTemplates(ns, parent, path, indentLevel, handler=generalHandler):
for node in parent.xpath(path, namespaces=ns):
name = node.get('name') or node.get('ref') or node.get('value')
if name is not None:
if name in ('nx:groupGroup'):
if name in ('nx:groupGroup',):
print(">"*45, name)
if name in db:
raise "Duplicate name found: " + name
Expand Down Expand Up @@ -438,6 +447,7 @@ def main(tree, ns):
"/xs:schema/xs:complexType[@name='docType']",
"/xs:schema/xs:complexType[@name='enumerationType']",
"/xs:schema/xs:complexType[@name='fieldType']",
"/xs:schema/xs:complexType[@name='choiceType']",
"/xs:schema/xs:complexType[@name='groupType']",
"/xs:schema/xs:complexType[@name='linkType']",
"/xs:schema/xs:complexType[@name='symbolsType']",
Expand Down

0 comments on commit ebf42b8

Please sign in to comment.