diff --git a/best_practices.md b/best_practices.md new file mode 100644 index 00000000..8f87bc4d --- /dev/null +++ b/best_practices.md @@ -0,0 +1,26 @@ +# Enumerations + +It is _*highly*_ recommended that DFDL schema authors avoid whitespace within the definition of +symbolic enumeration constants. Underscores should be use instead of spaces. + +## Enumerations and Validity + +The above example also illustrates an optional technique which segregates the enumeration values +into some that are schema-valid, and some that are not, based on an additional pattern facet which +constrains the valid symbolic values to names that begin with "OK_"[^checkConstraints]. + +[^checkConstraints] This particular MIL-STD-2045 schema +(as of this writing 2025-10-27) enforces the pattern facet at parse time, so it +is a parse error if the selected symbolic enumeration does not start with `"OK_"` meaning +only numeric values 2, 4, 5, 6, and 7 are considered well-formed. However, +this enforcement is not required and is not actually considered best practice. + +[TBD]: +Bug? In MIL-STD-2045, this string type has a dfdl:checkConstraints(.) assert on it. So these +facets are +enforced and cause a parse error if data does not adhere to them. +This is probably a mistake in +the schema, which should at least have a DFDL variable to control whether or not this +dfdl:assert will fail or not. +Best practice is to NOT use dfdl:checkConstraints(.), so as to +cleanly separate the concepts of well-formed and valid data. diff --git a/site/_data/footer.yml b/site/_data/footer.yml new file mode 100644 index 00000000..52c64ae8 --- /dev/null +++ b/site/_data/footer.yml @@ -0,0 +1,8 @@ +org_name: "The Apache Software Foundation" +org_url: "https://www.apache.org" +license_name: "Apache License, Version 2.0" +copyright_year: "2025" +license_url: "https://www.apache.org/licenses/LICENSE-2.0" +trademark_text: "Apache, Apache Daffodil, Daffodil, and the Apache Daffodil logo are trademarks of The Apache Software Foundation." +daffodil_logo: ../assets/themes/apache/img/apache-daffodil-logo.png +asf_logo: ../assets/themes/apache/img/asf_logo_wide.png diff --git a/site/_includes/themes/apache/default.html b/site/_includes/themes/apache/default.html index 264b9e14..462887ba 100644 --- a/site/_includes/themes/apache/default.html +++ b/site/_includes/themes/apache/default.html @@ -25,6 +25,10 @@ {% include themes/apache/_navigation.html %}
+ {% if page.pdf %} + {% assign filename_without_extension = page.path | split: '.' | first %} +
This page is available as a downloadable PDF
+ {% endif %} {{ content }}