Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address some unexpected warnings #1305

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
dfdl:byteOrder="littleEndian"/>
<xs:element name="le_int8" type="xs:byte"
dfdl:byteOrder="littleEndian"/>
<xs:element name="le_int46" type="xs:integer"
<xs:element name="le_int46" type="xs:long"
dfdl:byteOrder="littleEndian"
dfdl:length="46"
dfdl:lengthKind="explicit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<xs:complexType>
<xs:sequence>
<xs:element name="tag" type="tns:uint8"/>
<xs:choice dfdl:choiceDispatchKey="{ tns:tag }" >
<xs:choice dfdl:choiceDispatchKey="{ xs:string(tns:tag) }" >
<xs:element name="a" type="tns:emptyElt" dfdl:choiceBranchKey="0"/>
<xs:element name="b" type="tns:emptyElt" dfdl:choiceBranchKey="1 5" dfdlx:choiceBranchKeyRanges="10 100 110 255"/>
<xs:element name="c" type="tns:emptyElt" dfdl:choiceBranchKey="2 3 4"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,14 @@
</root1>
</tdml:dfdlInfoset>
</tdml:infoset>
<tdml:warnings>
<tdml:warning>FacetsContradict</tdml:warning>
<tdml:warning>'t'</tdml:warning>
<tdml:warning>three</tdml:warning>
<tdml:warning>contradicts</tdml:warning>
<tdml:warning>minLength</tdml:warning>
<tdml:warning>maxLength</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

<tdml:parserTestCase name="repType_length_facet_02"
Expand All @@ -824,6 +832,14 @@
<tdml:error>minLength</tdml:error>
<tdml:error>2</tdml:error>
</tdml:validationErrors>
<tdml:warnings>
<tdml:warning>FacetsContradict</tdml:warning>
<tdml:warning>'t'</tdml:warning>
<tdml:warning>three</tdml:warning>
<tdml:warning>contradicts</tdml:warning>
<tdml:warning>minLength</tdml:warning>
<tdml:warning>maxLength</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

<tdml:parserTestCase name="repType_length_facet_03"
Expand All @@ -844,6 +860,14 @@
<tdml:error>maxLength</tdml:error>
<tdml:error>3</tdml:error>
</tdml:validationErrors>
<tdml:warnings>
<tdml:warning>FacetsContradict</tdml:warning>
<tdml:warning>'t'</tdml:warning>
<tdml:warning>three</tdml:warning>
<tdml:warning>contradicts</tdml:warning>
<tdml:warning>minLength</tdml:warning>
<tdml:warning>maxLength</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

<tdml:parserTestCase name="repType_length_facet_04"
Expand All @@ -863,6 +887,14 @@
<tdml:error>ex:field</tdml:error>
<tdml:error>facet length (1)</tdml:error>
</tdml:validationErrors>
<tdml:warnings>
<tdml:warning>FacetsContradict</tdml:warning>
<tdml:warning>'t'</tdml:warning>
<tdml:warning>three</tdml:warning>
<tdml:warning>contradicts</tdml:warning>
<tdml:warning>minLength</tdml:warning>
<tdml:warning>maxLength</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

<tdml:parserTestCase name="repType_length_facet_05"
Expand All @@ -878,6 +910,14 @@
</root2>
</tdml:dfdlInfoset>
</tdml:infoset>
<tdml:warnings>
<tdml:warning>FacetsContradict</tdml:warning>
<tdml:warning>'t'</tdml:warning>
<tdml:warning>three</tdml:warning>
<tdml:warning>contradicts</tdml:warning>
<tdml:warning>minLength</tdml:warning>
<tdml:warning>maxLength</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

<tdml:parserTestCase name="repType_length_facet_06"
Expand All @@ -897,6 +937,14 @@
<tdml:error>ex:field</tdml:error>
<tdml:error>facet length (1)</tdml:error>
</tdml:validationErrors>
<tdml:warnings>
<tdml:warning>FacetsContradict</tdml:warning>
<tdml:warning>'t'</tdml:warning>
<tdml:warning>three</tdml:warning>
<tdml:warning>contradicts</tdml:warning>
<tdml:warning>minLength</tdml:warning>
<tdml:warning>maxLength</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

<tdml:defineSchema name="repType-Negative.dfdl.xsd">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:cd="urn:org.apache.daffodil.layers.checkDigit"
xmlns:ex="http://example.com"
xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext"
targetNamespace="http://example.com">

<include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
Expand Down Expand Up @@ -69,6 +70,7 @@
dfdl:inputValueCalc='{ $cd:checkDigit }'/>
<element name="invalidCheckDigit" type="ex:alwaysInvalid" minOccurs="0"
dfdl:occursCountKind="expression"
daf:suppressSchemaDefinitionWarnings="facetExplicitLengthOutOfRange"
dfdl:occursCount="{ if (../checkDigit eq ../computedCheckDigit) then 0 else 1 }"/>
</sequence> <!-- checkDigit DFDL variable scope ends here -->
</complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<tns:r1>foo</tns:r1>
</tdml:dfdlInfoset>
</tdml:infoset>
<tdml:warnings>
<tdml:warning>Non-DFDL Schema file ignored</tdml:warning>
<tdml:warning>otherAnnotationLanguage.xsd</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

<tdml:parserTestCase name="importOtherAnnotationSchema2" root="r2" model="schemaWithOtherAnnotations.dfdl.xsd">
Expand All @@ -43,6 +47,10 @@
<tns:r2>foo</tns:r2>
</tdml:dfdlInfoset>
</tdml:infoset>
<tdml:warnings>
<tdml:warning>Non-DFDL Schema file ignored</tdml:warning>
<tdml:warning>otherAnnotationLanguage.xsd</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

</tdml:testSuite>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<tdml:testSuite xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://example.com"
xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext"
suiteName="generalUnparserTests">

<tdml:defineSchema name="fixedLengthStrings">
Expand All @@ -32,7 +33,9 @@
<xs:complexType>
<xs:sequence dfdl:initiator="[" dfdl:separator="," dfdl:terminator="]">
<xs:element name="s1" dfdl:lengthKind="explicit" dfdl:length="0" type="xs:string" dfdl:textPadKind='none'/>
<xs:element name="s2" dfdl:lengthKind="explicit" dfdl:length="1" type="xs:string" dfdl:textPadKind='none' default="broken"/>
<xs:element name="s2" dfdl:lengthKind="explicit" dfdl:length="1" type="xs:string" dfdl:textPadKind='none'
daf:suppressSchemaDefinitionWarnings="noEmptyDefault"
default="broken"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
trailingSkip="0" encoding="US-ASCII" alignment="1" alignmentUnits="bytes" initiator=""
terminator="" separator="" ignoreCase="no" occursCountKind="implicit" lengthUnits="bytes"
initiatedContent="no" textPadKind="none" truncateSpecifiedLengthString="no" textTrimKind="none"
escapeSchemeRef="" encodingErrorPolicy="replace" fillByte="%NUL;" />
escapeSchemeRef="" encodingErrorPolicy="replace" fillByte="%NUL;" floating="no" />

<xs:element name="root">
<xs:complexType>
Expand Down Expand Up @@ -551,7 +551,7 @@
trailingSkip="0" encoding="US-ASCII" alignment="1" alignmentUnits="bytes" initiator=""
terminator="" separator="" ignoreCase="no" occursCountKind="implicit" lengthUnits="bytes"
initiatedContent="no" textPadKind="none" truncateSpecifiedLengthString="no" textTrimKind="none"
escapeSchemeRef="" encodingErrorPolicy="replace" textBidi="yes"/>
escapeSchemeRef="" encodingErrorPolicy="replace" textBidi="yes" floating="no"/>

<xs:element name="root">
<xs:complexType>
Expand Down Expand Up @@ -729,7 +729,7 @@
trailingSkip="0" encoding="US-ASCII" alignment="1" alignmentUnits="bytes" initiator=""
terminator="" separator="" ignoreCase="no" occursCountKind="implicit" lengthUnits="bytes"
initiatedContent="no" textPadKind="none" truncateSpecifiedLengthString="no" textTrimKind="none"
escapeSchemeRef="" textBidi="no" fillByte="%NUL;" />
escapeSchemeRef="" textBidi="no" fillByte="%NUL;" floating="no" />

<xs:element name="root">
<xs:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@
calendarLanguage="en" calendarPatternKind="implicit"
calendarTimeZone="UTC" decimalSigned="yes"
documentFinalTerminatorCanBeMissing="no"
emptyValueDelimiterPolicy="both" encodingErrorPolicy="error"
encoding="utf-8" escapeSchemeRef="" fillByte="%#r20;" ignoreCase="no"
emptyValueDelimiterPolicy="both" encodingErrorPolicy="replace"
encoding="utf-8" escapeSchemeRef="" fillByte="%#r20;" floating="no" ignoreCase="no"
initiatedContent="no" initiator="" lengthKind="delimited"
lengthUnits="bytes" occursCountKind="parsed" outputNewLine="%LF;"
representation="text" separator="" separatorPosition="infix"
separatorSuppressionPolicy="anyEmpty" sequenceKind="ordered"
terminator="" textBooleanPadCharacter="%SP;"
terminator="" textBooleanPadCharacter="%SP;" textBidi="no"
textCalendarJustification="left" textCalendarPadCharacter="%SP;"
textNumberCheckPolicy="lax" textNumberJustification="right"
textNumberPadCharacter="%SP;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2910,7 +2910,7 @@
<xs:element name="e1" type="xs:int"
dfdl:lengthKind="delimited" />
<xs:element name="e2" nillable="true" type="ex:st8"
dfdl:lengthKind="delimited" dfdl:nilValueDelimiterPolicy="terminator"
dfdl:lengthKind="delimited"
dfdl:nilValue="567 %ES;" dfdl:nilKind="literalValue">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,12 @@
textStandardZeroRep="0" textStandardInfinityRep="Inf" textStandardNaNRep="NaN"
textNumberPattern="#,##0.###;-#,##0.###" textNumberRounding="explicit"
textNumberRoundingMode="roundUnnecessary" textNumberRoundingIncrement="0" decimalSigned="yes"
encodingErrorPolicy="error" sequenceKind="ordered" calendarFirstDayOfWeek='Sunday'
encodingErrorPolicy="replace" sequenceKind="ordered" calendarFirstDayOfWeek='Sunday'
calendarDaysInFirstWeek='4' calendarTimeZone='UTC' calendarCheckPolicy='strict' calendarLanguage='en'
bitOrder="leastSignificantBitFirst" outputNewLine="%LF;" textPadKind="none" fillByte="%#r20;"
truncateSpecifiedLengthString="no" textStringPadCharacter="%SP;" textNumberPadCharacter="%SP;"
textBooleanPadCharacter="%SP;" textCalendarPadCharacter="%SP;" textCalendarJustification="left"
textNumberJustification="right" textOutputMinLength="0" />
textNumberJustification="right" textOutputMinLength="0" floating="no" textBidi="no" />

<xs:element name="e1" dfdl:lengthKind='implicit'>
<xs:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
defaultRoundTrip="true">

<tdml:defineSchema name="SimpleTypes-Embedded.dfdl.xsd">
<xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormatPortable.dfdl.xsd"/>
<xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
<dfdl:format ref="ex:GeneralFormat" lengthKind="implicit" representation="text"
lengthUnits="bytes" encoding="US-ASCII" initiator="" terminator=""
separator="" textNumberCheckPolicy="lax" ignoreCase="no" textNumberRep="standard"
lengthUnits="bytes" encoding="US-ASCII" initiator="" terminator="" calendarTimeZone="UTC"
separator="" textNumberCheckPolicy="lax" ignoreCase="no" textNumberRep="standard"
textPadKind="padChar" textTrimKind="padChar"/>
<xs:element name="double" type="xs:double"/>
<xs:element name="int" type="xs:int"/>
Expand All @@ -50,8 +50,9 @@
dfdl:length="13" />
<xs:element name="int02" type="xs:int" dfdl:lengthKind="explicit"
dfdl:length="11" />
<xs:element name="int03" type="xs:int" dfdl:representation="binary"
dfdl:binaryNumberRep="binary" />
<xs:element name="int03" type="xs:int" dfdl:binaryNumberRep="binary"
dfdl:lengthKind="explicit"
dfdl:length="4"/>
<xs:element name="int04" type="xs:int" dfdl:lengthKind="explicit"
dfdl:length="10" />
<xs:element name="int05" type="xs:int" dfdl:lengthKind="explicit"
Expand Down Expand Up @@ -159,12 +160,9 @@
dfdl:lengthKind="explicit" dfdl:length="{ 8 }" />
<xs:element name="dateTimeText" type="xs:dateTime" dfdl:calendarPattern="yyyy.MM.dd G 'at' HH:mm:ss ZZZZ" dfdl:calendarPatternKind="explicit"
dfdl:lengthKind="explicit" dfdl:length="{ 35 }" />
<xs:element name="dateTextInvalid" type="xs:date" dfdl:calendarPattern="EEEE, MMM d, ''yy" dfdl:calendarPatternKind="explicit"
dfdl:lengthKind="implicit" dfdl:inputValueCalc="{ xs:string('Wday, July 10, 1996') }" />
<xs:element name="timeTextInvalid" type="xs:time" dfdl:calendarPattern="h:mm a" dfdl:calendarPatternKind="explicit"
dfdl:lengthKind="implicit" dfdl:inputValueCalc="{ xs:string('not a time') }" />
<xs:element name="dateTimeTextInvalid" type="xs:dateTime" dfdl:calendarPattern="yyyy.MM.dd G 'at' HH:mm:ss ZZZZ" dfdl:calendarPatternKind="explicit"
dfdl:lengthKind="implicit" dfdl:inputValueCalc="{ xs:string('not a date time') }" />
<xs:element name="dateTextInvalid" type="xs:date" dfdl:inputValueCalc="{ xs:string('Wday, July 10, 1996') }" />
<xs:element name="timeTextInvalid" type="xs:time" dfdl:inputValueCalc="{ xs:string('not a time') }" />
<xs:element name="dateTimeTextInvalid" type="xs:dateTime" dfdl:inputValueCalc="{ xs:string('not a date time') }" />

<xs:element name="limits" dfdl:lengthKind="implicit">
<xs:complexType>
Expand Down Expand Up @@ -205,9 +203,9 @@
</tdml:defineSchema>

<tdml:defineSchema name="SimpleTypes-binary">
<xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormatPortable.dfdl.xsd"/>
<xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
<dfdl:format ref="ex:GeneralFormat" representation="binary"
lengthUnits="bytes"
lengthUnits="bytes" calendarTimeZone="UTC"
textPadKind="padChar" textTrimKind="padChar" />

<xs:element name="integer01" type="xs:integer" />
Expand Down Expand Up @@ -542,19 +540,21 @@

<tdml:parserTestCase name="warning_exercise" root="int03"
model="SimpleTypes-Embedded.dfdl.xsd"
description="A warning message should be generated - use of binaryNumperRep 'binary' with representation 'text'- DFDL-2-012R">
description="A warning message should be generated - use of binaryNumperRep 'binary' with representation 'text'- DFDL-2-012R"
ignoreUnexpectedWarnings="false">

<tdml:document>
<tdml:documentPart type="byte">00000025</tdml:documentPart>
<tdml:documentPart type="text"> 37</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<int03 xsi:type="xs:int">37</int03>
</tdml:dfdlInfoset>
</tdml:infoset>
<tdml:warnings>
<tdml:warning /><!-- don't care what message is -->
<tdml:warning>binaryNumberRep</tdml:warning>
<tdml:warning>ignored</tdml:warning>
</tdml:warnings>
</tdml:parserTestCase>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
schemaLocation="/IBMdefined/GeneralPurposeFormat.xsd" />
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format ref="fmt:GeneralPurposeFormat" />
<dfdl:format ref="fmt:GeneralPurposeFormat" encodingErrorPolicy="replace"/>
</xsd:appinfo>
</xsd:annotation>

<xsd:element dfdl:initiator="Date:%SP;" dfdl:terminator="%NL;"
ibmSchExtn:docRoot="true" name="Date">
<xsd:complexType>
<xsd:sequence dfdl:initiator="" dfdl:separator="%SP;"
dfdl:separatorPolicy="suppressed">
<xsd:sequence dfdl:initiator="" dfdl:separator="%SP;">
<xsd:element dfdl:length="2" dfdl:lengthKind="explicit"
dfdl:textNumberPattern="#0" ibmDfdlExtn:sampleValue="1" name="Day">
<xsd:simpleType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ xmlns:tns="http://example.com">
initiatedContent="no" initiator="" leadingSkip="0" lengthKind="delimited"
lengthUnits="characters" nilKind="literalValue" nilValueDelimiterPolicy="none"
occursCountKind="fixed" outputNewLine="%CR;%LF;" prefixIncludesPrefixLength="no"
representation="text" separator="," separatorPolicy="required"
representation="text" separator=","
separatorPosition="infix" sequenceKind="ordered" terminator="" textBidi="no"
textBooleanFalseRep="false" textBooleanJustification="left"
textBooleanPadCharacter="%SP;" textBooleanTrueRep="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format ref="tns:GeneralPurposeFormat"
separatorSuppressionPolicy="trailingEmpty" />
separatorSuppressionPolicy="trailingEmpty"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
byteOrder="littleEndian" calendarCheckPolicy='strict'
calendarDaysInFirstWeek='4' calendarFirstDayOfWeek='Sunday'
calendarLanguage='en' calendarPatternKind='implicit' calendarTimeZone='UTC'
encoding="ASCII" encodingErrorPolicy="error" escapeSchemeRef=""
encoding="ASCII" encodingErrorPolicy="replace" escapeSchemeRef=""
fillByte="%#r20;" ignoreCase="no" initiatedContent="no" initiator=""
leadingSkip='0' occursCountKind="parsed" outputNewLine="%LF;"
representation="text" separator="" separatorPosition="infix"
Expand All @@ -45,7 +45,7 @@
textNumberPadCharacter="%SP;" textNumberRep="standard" textOutputMinLength="0"
textPadKind="none" textStringPadCharacter="%SP;" textTrimKind="none"
trailingSkip="0" truncateSpecifiedLengthString="no"
emptyValueDelimiterPolicy="none"/>
emptyValueDelimiterPolicy="none" floating="no" textBidi="no" textStandardBase="10"/>
</xs:appinfo>
</xs:annotation>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format sequenceKind='ordered' bitOrder="mostSignificantBitFirst" encodingErrorPolicy="error" separator="'" initiator="" terminator="" leadingSkip='0' textTrimKind="none" initiatedContent="no"
<dfdl:format sequenceKind='ordered' bitOrder="mostSignificantBitFirst" encodingErrorPolicy="replace" separator="'" initiator="" terminator="" leadingSkip='0' textTrimKind="none" initiatedContent="no"
separatorPosition="infix" ignoreCase="no" separatorSuppressionPolicy="anyEmpty" representation="text"
textNumberRep="standard" lengthKind="delimited" encoding="ASCII"
alignment="implicit" alignmentUnits="bytes" trailingSkip="0" outputNewLine="%LF;"
fillByte="%SP;" truncateSpecifiedLengthString="yes" escapeSchemeRef=""
textPadKind='none' byteOrder="littleEndian"/>
textPadKind='none' byteOrder="littleEndian" floating="no" textBidi="no"/>
</xs:appinfo>
</xs:annotation>

Expand Down
Binary file not shown.
Loading
Loading