[ 
https://issues.apache.org/jira/browse/DAFFODIL-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16669399#comment-16669399
 ] 

Michael Beckerle commented on DAFFODIL-1616:
--------------------------------------------

Don't have an obvious way to reproduce the user's error, but this property is 
only needed, and should only be looked for under a very narrow set of 
circumstances. 

type is simple, but not string nor hexBinary
representation is text
textPadKind is padChar
lengthKind is one of delimited, prefixed, pattern, endOfParent, or explicit 
when length is NOT a constant.

When those are all true, then to determine the minimum length (for an 
unparser), we use this property. 

The code for textOutputMinLength now simply checks all the above. 

Tests of the IBM DFDL Cross-test rig run IBM samples that do not have 
textOutputMinLength defined. These tests used to fail for lack of this property 
(and we modifed the schemas to have it). Now the schemas are modified to NOT 
have the property and these tests work:

They are in the test class TestIBMDFDLSamples.test_company1() and 
test_company1SelfContained(). 

That cross test rig was created in github and can be cloned via git clone 
[email protected]:OpenDFDL/ibmDFDLCrossTester.git
It may, however, move elsewhere... perhaps to DFDLSchemas?

> textOutputMinLength required when it shouldn't be needed
> --------------------------------------------------------
>
>                 Key: DAFFODIL-1616
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1616
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, Compatibility, General, Middle "End"
>    Affects Versions: 2.0.0
>            Reporter: Michael Beckerle
>            Assignee: Michael Beckerle
>            Priority: Blocker
>              Labels: ForInteroperabilityTest, beginner
>
> A user reports that his entirely binary format is getting an error that 
> textOutputMinLength is required. 
> Excerpt from email thread is below:
> .... I am getting strange error after I try to compile my schema:
>     15:29:32.273 [main] DEBUG int_.nato.ncia.maniaccs.App - DFLD file's URL: 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml
>     15:29:32.275 [main] INFO  int_.nato.ncia.maniaccs.App - compiling ASTERIX 
> DFDL defs...
>     15:29:37.058 [main] ERROR int_.nato.ncia.maniaccs.App - There was an 
> error while compiling the DFDL sources
>     15:29:37.062 [main] ERROR int_.nato.ncia.maniaccs.App - Schema Definition 
> Error: Property textOutputMinLength is not defined.
>     Non-default properties were combined from these locations:
>     Location line 1583 in 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml
>     Location line 17 in 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml
>     Default properties were taken from these locations:
>     Location line 9 column 8 in 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml
>     Location line 7 column 10 in 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml
>     Location line 9 column 8 in 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml
>     Location line 7 column 10 in 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml
>     Schema context: element.CAT. Location line 1583 column 16 in 
> jar:file:/home/luke/work/projects/mini-accs/socket-listener/target/data-socket-listener-1.0-SNAPSHOT.jar!/dfdl/asterix.dfdl.xml.
> (Note that I have been using the very same DFDL definition when running the 
> TDML test that I have prepared)
> I checked the docs and, in section 13.2, it says that 'textOutputMinLength' 
> is 'common to all simple types with text representation'; in my DFDL, there 
> are _no_ fields with such representation, I use only (unsigned) integers and 
> bit flags.
> I checked the line in error message 'Schema context': it looks like this:
>                   <xs:element name="CAT" type="adatp-35:ushort8"/>
> while the 'adatp-35:ushort8' type is defined as follows:
>       <xs:simpleType name="ushort8" dfdl:lengthKind="explicit" 
> dfdl:length="1" dfdl:lengthUnits="bytes">
>         <xs:restriction base="xs:unsignedInt"/>
>       </xs:simpleType>
> Any help would be greatly appreciated!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to