Giter VIP home page Giter VIP logo

mil-std-2045's People

Contributors

jadams-tresys avatar mbeckerle avatar olabusayot avatar parkera101093 avatar smhdfdl avatar sramaka avatar stevedlawrence avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mil-std-2045's Issues

Add test of acknowledgement

Some messages have no payload and are acknowledgements.

A test illustrating one of these would be helpful.

%WSP*; will incorrectly absorb binary data after max length strings

mil-std-2045 makes use of this trick for strings that have DEL characters delimiting them when they are less than their max length:

<xs:group name="tString50">
xs:sequence
<xs:element name="value" type="xs:string" dfdl:lengthKind="pattern"
dfdl:lengthPattern="[^\x7F]{0,49}(?=\x7F)|.{50}"/>
<xs:sequence
dfdl:terminator="{if (fn:string-length(./value) eq 50)
then '%WSP*;'
else '%DEL;'
}"/>

</xs:sequence>
</xs:group>

This is incorrect because %WSP*; is incorrect.

This data will not parse as a string of length 50, not followed by a DEL, but will instead absorb the space characters after the text:

"abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde "

(That's 50 characters followed by 10 spaces.)

If binary data happens to follow an element of this type tString50, and the bits of that binary data just so happen to match the bit patterns of whitespace characters, then this format will erroneously absorb them. For example, if a tString50 of length 50 is followed by a 32 bit integer having value 0x20202020, then those 4 bytes will be absorbed by the WSP*.

The intent of the dfdl:terminator expression is if the string length is 50, to NOT have a terminator region, i.e., %ES; is the correct value to be used here, not %WSP*;.

The problem is that in the DFDL spec, %ES; alone as the only string literal for a terminator (or any delimiter) is not allowed.

This constraint in the DFDL spec is probably incorrect - in the above case, we are NOT scanning for delimiters as in dfdl:lengthKind 'delimited' so it does no harm to say the terminator is '%ES;' alone. This topic has been raised with the DFDL Workgroup mailing list for discussion (on 2018-10-01).

Until this is resolved, I suggest these possible workarounds.... which may or may not work.

Replace '%WSP*; above with "%ES;%ES;" or "%ES; %ES;". Both meet the letter of the constraint in the DFDL spec., and so may bypass Daffodil checking. But they mean the same thing as just '%ES;' by itself.

mil-std-2045 D1 schema should suppress elements for empty futureUseGroup1, 2, 3

This can be done like this:

<xs:choice>
  <xs:sequence dfdl:hiddenGroupRef="tns:emptyFutureUseGroup"/><!-- 5 bits all 0 -->
  <xs:group ref="tns:futureUseGroup2"/>
</xs:choice>

This will also allow removal of the not-needed enveloping element futureUseGroup1 (or 2, or 3) and allow the future use elements to appear at the top level without this.

Use symbolic enums

Daffodil has experimental feature support to decode numeric enums into their symbolic strings.

Something like this will eventually be incorporated into the DFDL standard, and having this would make this schema far more useful.

So add the dfdlx:repType and dfdlx:repValues (to the enumerations of the strings) so this does symbolic decode.

binary file message type test needed

One variant of a mil-std-2045 message is where the UMF (user message format) field is "0001" which means "binary file". In this case the data after the header is the contents of a binary file. The file name of this is given in another field (which must be present).

We need a test of this.

Uses of this DFDL Schema need to be able to combine this header with definitions of what the contents of that binary file content contains. That is, this schema cannot take the position that this binary file content is to be represented as some hexBinary element. The binary file content is actually beyond the end of the header; hence, isn't part of this schema.

enhance to convert date time in many fields to/from a single DFDL date, time, or dateTime type

There are many dates/times/datetimes in this schema, and it would really help if these were not parsed as individual fields, but were converted into xs:date, xs:time, or xs:dateTime fields. So as to avoid this:

             <year>
              <value>19</value>
              </year>
              <month>
                <value>1</value>
              </month>
              <day>
                <value>22</value>
              </day>
              <hour>
                <value>4</value>
              </hour>
              <minute>
                <value>50</value>
              </minute>
              <second>
                <value>10</value>
              </second>

And instead get:
<dateTime>2019-01-22T04:50:10</dateTime>

XML_VMF versioning incorrect

As with the VMF versioning which uses a different enum for C and for D1 which are not consistent with each other, the same issue arises for XML_VMF.

The enum messsageStandardVersionXML_VMFEnum must be split into a C and D1 variant, in a manner similar to what was done for regular messageStandardVersionVMFEnum_C and messageStandardVersionVMFEnum_D1, with corresponding messageStandardVersionVMFGroup.

Schema does not enforce constraints from section 5.7.2

The schema should enforce a internal constraints on message type.

A 2045 message header can have an array of message_handling_groups

Each message_handling_group has a UMF indicating if the data is Link16, Binary File, VMF, NITF, etc.

For some of those there is a more granular message_standard_version which tells us which specific version of that standard.

Following that there is an optional vmf_message_identification_group, which obviously applies only to VMF, but this is not enforced. This contains the K-series message ID information (K01.02.03 type identification), which is not held in a VMF-message proper so must come from this header.

Following that there is an optional file_name which is NOT applicable to VMF, but to binary files, and possibly other types.
(E.g., if NITF data is carried it is not clear if there is an associated file name, or just a collection of bytes for an anonymous NITF data block.)

Right now, the message type can indicate VMF, but the data can still contain a file-name as if it was for a binary file.

Improve strings

The variable-length strings idiom can be improved with a assert (test Kind pattern) and by adding a max-length facet to each string.

update schemaLocations

Update paths for schemaLocation attributes. Absolute paths should start with "/", relative sibling files should have no paths.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.