You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by "Costello, Roger L." <co...@mitre.org> on 2020/04/08 18:44:05 UTC

Would you change defineFormat to defineGlobalProperties and format to globalProperties, please?

Hi Folks,

The purpose of the top-level xs:appinfo is to specify properties that apply over the entire DFDL schema. That is, the purpose is to specify properties with global scope. For example, we want representation=text to apply over the entire schema. Do you agree? If so, then it seems to me that the element names used to specify these global properties should contain words like "global" and "properties".  I think defineGlobalProperties is more meaningful than defineFormat and globalProperties is more meaningful than format. Would it be possible to change those element names? I think the below is good:

<xs:annotation>
    <xs:appinfo>
        <dfdl:defineGlobalProperties name="global-properties-for-xyz-data-format">
            <dfdl:globalProperties
                alignment="1"
                alignmentUnits="bytes"
                     ...
/Roger


Re: Would you change defineFormat to defineGlobalProperties and format to globalProperties, please?

Posted by "Beckerle, Mike" <mb...@tresys.com>.
I disagree.

The top level appinfo DFDL annotations consist of two kinds.

1) definitions of named entities - formats, variables, escape-schemes.
2) the dfdl:format annotation

Type (1) definitions add things to that xs:schema element's target namespace (or no namespace if there isn't one). So this is relative to that specific schema file, not global.  Well, It's only global if you are using no-namespace, as there is only one such non-namespace thing.

Type (2) dfdl:format puts a format into use as the default format for that file (that xs:schema element instance) contents lexically. Again this is not global. It's lexical scoping.  DFDL schemas are commonly distributed across many files. Not all those files use the same default format even if they share the same target namespace. This is common and very useful.

XSD doesn't have many things that have lexical scope, but namespace prefix bindings are one, and there are a few key attributes in  xs:schema (e.g., elementFormDefault) that have lexical action/scope.

I am not sure I know any precedent for this sort of naming convention you are suggesting where global definitions contain or require an additional keyword. E.g., XSD itself doesn't have xs:globalElement and xs:localElement. It just has xs:element and makes distinctions lexically based on position.  When I think of formal languages, the ones that come to mind all tend to use lexical position for scoping.

________________________________
From: Costello, Roger L. <co...@mitre.org>
Sent: Wednesday, April 8, 2020 2:44 PM
To: users@daffodil.apache.org <us...@daffodil.apache.org>
Subject: Would you change defineFormat to defineGlobalProperties and format to globalProperties, please?


Hi Folks,



The purpose of the top-level xs:appinfo is to specify properties that apply over the entire DFDL schema. That is, the purpose is to specify properties with global scope. For example, we want representation=text to apply over the entire schema. Do you agree? If so, then it seems to me that the element names used to specify these global properties should contain words like “global” and “properties”.  I think defineGlobalProperties is more meaningful than defineFormat and globalProperties is more meaningful than format. Would it be possible to change those element names? I think the below is good:



<xs:annotation>
    <xs:appinfo>
        <dfdl:defineGlobalProperties name="global-properties-for-xyz-data-format">
            <dfdl:globalProperties
                alignment="1"
                alignmentUnits="bytes"

                     …

/Roger