diff --git a/iocBoot/NeXus_templates.xsd b/iocBoot/NeXus_templates.xsd index 605d4cf..5ee491f 100755 --- a/iocBoot/NeXus_templates.xsd +++ b/iocBoot/NeXus_templates.xsd @@ -10,14 +10,24 @@ ########### SVN repository information ################### --> + + diff --git a/iocBoot/template.sch b/iocBoot/template.sch new file mode 100755 index 0000000..4f9eeb4 --- /dev/null +++ b/iocBoot/template.sch @@ -0,0 +1,155 @@ + + + + + + + + + validate EPICS areaDetector NeXus template file + + + + + + + name attribute must be less than 64 characters + Do not start names with "NX" (reserved by NeXus) + + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must start with a letter or "_" + names must NOT start with whitespace + names must not contain a space + names must not contain a "&" + names must not contain a ">" + names must not contain a "<" + names must not contain a "!" + names must not contain a "#" + names must not contain a "%" + names must not contain a "(" + names must not contain a ")" + names must not contain a "*" + names must not contain a "+" + names must not contain a "," + names must not contain a "-" + names must not contain a "." + names must not contain a "/" + names must not contain a ":" + names must not contain a ";" + names must not contain a "?" + names must not contain a "@" + names must not contain a "[" + names must not contain a "\" + names must not contain a "]" + names must not contain a "^" + names must not contain a "{" + names must not contain a "|" + names must not contain a "}" + names must not contain a "~" + + + + + + + /NXroot must contain at least one NXentry group + + + + + + + NXentry must contain at least one NXdata group + + + + + + + + NXdata must contain one dataset with type="pArray" (image data) + + + NXdata must contain a dataset with attribute "signal" + + + + + + + + + + must provide a "source" attribute for ND_ATTR + + + must use type="ND_ATTR" when specifying a source + + + + + Group needs a type="UserGroup" attribute + + + + + NeXus group must have a "name" attribute + + + + + diff --git a/iocBoot/validateXML.sh b/iocBoot/validateXML.sh index 5edf6dd..be67831 100755 --- a/iocBoot/validateXML.sh +++ b/iocBoot/validateXML.sh @@ -10,20 +10,19 @@ # Validate the XML Attribute and Template files +ATTRIBUTE_SCHEMA="--noout --schema ./attributes.xsd" +#TEMPLATE_SCHEMA="--noout --schema ./NeXus_templates.xsd" +TEMPLATE_SCHEMA="--noout --schematron ./template.sch" # NDArray Attribute declaration files -xmllint --noout --schema ./attributes.xsd iocPerkinElmer/nexus_templates/PerkinElmerParams.xml -xmllint --noout --schema ./attributes.xsd iocPilatus/pilatusAttributes.xml -xmllint --noout --schema ./attributes.xsd iocProsilica/prosilicaAttributes.xml -xmllint --noout --schema ./attributes.xsd iocSimDetector/ROIAttributes.xml -xmllint --noout --schema ./attributes.xsd iocSimDetector/netCDFAttributes.xml -xmllint --noout --schema ./attributes.xsd iocSimDetector/simDetectorAttributes.xml +xmllint ${ATTRIBUTE_SCHEMA} iocPerkinElmer/nexus_templates/PerkinElmerParams.xml +xmllint ${ATTRIBUTE_SCHEMA} iocPilatus/pilatusAttributes.xml +xmllint ${ATTRIBUTE_SCHEMA} iocProsilica/prosilicaAttributes.xml +xmllint ${ATTRIBUTE_SCHEMA} iocSimDetector/ROIAttributes.xml +xmllint ${ATTRIBUTE_SCHEMA} iocSimDetector/netCDFAttributes.xml +xmllint ${ATTRIBUTE_SCHEMA} iocSimDetector/simDetectorAttributes.xml -# template files +# NeXus file writer plugin template files # -# cannot validate, no XML Schema developed yet -# -#iocPerkinElmer/nexus_templates/example.xml fails to validate -#iocSimDetector/NexusTemplate.xml fails to validate -xmllint --noout --schema ./NeXus_templates.xsd iocPerkinElmer/nexus_templates/example.xml -xmllint --noout --schema ./NeXus_templates.xsd iocSimDetector/NexusTemplate.xml +xmllint ${TEMPLATE_SCHEMA} iocPerkinElmer/nexus_templates/example.xml +xmllint ${TEMPLATE_SCHEMA} iocSimDetector/NexusTemplate.xml