stevedlawrence closed pull request #54: Adds missing properties to
DFDLGeneralFormat.dfdl.xsd
URL: https://github.com/apache/incubator-daffodil/pull/54
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/daffodil-core/src/main/scala/org/apache/daffodil/dsom/TermEncodingMixin.scala
b/daffodil-core/src/main/scala/org/apache/daffodil/dsom/TermEncodingMixin.scala
index b911f0e8c..bf4b8fb78 100644
---
a/daffodil-core/src/main/scala/org/apache/daffodil/dsom/TermEncodingMixin.scala
+++
b/daffodil-core/src/main/scala/org/apache/daffodil/dsom/TermEncodingMixin.scala
@@ -22,6 +22,7 @@ import
org.apache.daffodil.schema.annotation.props.gen.Representation
import org.apache.daffodil.schema.annotation.props.gen.EncodingErrorPolicy
import org.apache.daffodil.processors.KnownEncodingMixin
import org.apache.daffodil.api.WarnID
+import org.apache.daffodil.schema.annotation.props.gen.YesNo
/**
* Captures concepts around dfdl:encoding property and Terms.
@@ -31,6 +32,15 @@ import org.apache.daffodil.api.WarnID
trait TermEncodingMixin extends KnownEncodingMixin { self: Term =>
requiredEvaluations(encodingInfo.preSerialization)
+ requiredEvaluations(checkTextBidi)
+
+ private lazy val optionTextBiDi = findPropertyOption("textBiDi")
+
+ private def checkTextBidi = {
+ this.subset(
+ !optionTextBiDi.isDefined || (optionTextBiDi.isDefined && (textBiDi eq
YesNo.No)),
+ "Property value textBiDi='yes' is not supported.")
+ }
protected final lazy val defaultEncodingErrorPolicy = {
val policy =
@@ -41,7 +51,8 @@ trait TermEncodingMixin extends KnownEncodingMixin { self:
Term =>
}
if (policy == EncodingErrorPolicy.Error) {
// DFDL-935 to enable
- notYetImplemented("dfdl:encodingErrorPolicy=\"error\"")
+ SDW(WarnID.EncodingErrorPolicyError, "dfdl:encodingErrorPolicy=\"error\"
is not yet implemented. The 'replace' value will be used.")
+ EncodingErrorPolicy.Replace
}
policy
}
diff --git
a/daffodil-lib/src/main/resources/edu/illinois/ncsa/daffodil/xsd/built-in-formats.xsd
b/daffodil-lib/src/main/resources/edu/illinois/ncsa/daffodil/xsd/built-in-formats.xsd
index db263e3b2..cd9548f7c 100644
---
a/daffodil-lib/src/main/resources/edu/illinois/ncsa/daffodil/xsd/built-in-formats.xsd
+++
b/daffodil-lib/src/main/resources/edu/illinois/ncsa/daffodil/xsd/built-in-formats.xsd
@@ -48,7 +48,8 @@
textStandardZeroRep="0"
textStandardInfinityRep="Inf"
textStandardNaNRep="NaN"
textNumberPattern="#,##0.###;-#,##0.###"
textNumberRounding="explicit"
textNumberRoundingMode="roundUnnecessary"
- textNumberRoundingIncrement="0"
decimalSigned="yes"/>
+ textNumberRoundingIncrement="0"
decimalSigned="yes"
+ />
</dfdl:defineFormat>
<!-- As we add new properties, add them here. -->
@@ -70,7 +71,12 @@
textBooleanPadCharacter="%SP;"
textCalendarPadCharacter="%SP;"
textCalendarJustification="left"
textNumberJustification="right"
- textOutputMinLength="0" />
+ textOutputMinLength="0"
+ floating="no"
+ calendarCenturyStart="53"
+ calendarObserveDST="yes"
+ textBiDi="no"
+ />
</dfdl:defineFormat>
</xs:appinfo>
diff --git
a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd
b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd
index 069aef5d3..2de258856 100644
---
a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd
+++
b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd
@@ -31,10 +31,12 @@
binaryNumberRep="binary"
bitOrder="mostSignificantBitFirst"
byteOrder="bigEndian"
+ calendarCenturyStart="53"
calendarCheckPolicy="strict"
calendarDaysInFirstWeek="4"
calendarFirstDayOfWeek="Sunday"
calendarLanguage="en"
+ calendarObserveDST="yes"
calendarPatternKind="implicit"
calendarTimeZone="UTC"
decimalSigned="yes"
@@ -44,6 +46,7 @@
encoding="US-ASCII"
escapeSchemeRef=""
fillByte="%#r20;"
+ floating="no"
ignoreCase="no"
initiatedContent="no"
initiator=""
@@ -58,6 +61,7 @@
separatorSuppressionPolicy="anyEmpty"
sequenceKind="ordered"
terminator=""
+ textBiDi="no"
textBooleanPadCharacter="%SP;"
textCalendarJustification="left"
textCalendarPadCharacter="%SP;"
diff --git a/daffodil-lib/src/main/scala/org/apache/daffodil/api/WarnID.scala
b/daffodil-lib/src/main/scala/org/apache/daffodil/api/WarnID.scala
index b7cafeaec..d23708d5c 100644
--- a/daffodil-lib/src/main/scala/org/apache/daffodil/api/WarnID.scala
+++ b/daffodil-lib/src/main/scala/org/apache/daffodil/api/WarnID.scala
@@ -59,6 +59,7 @@ object WarnID extends PropsEnum[WarnID] {
* Deprecated properties should all begin with "DeprecatedProperty..."
*/
case object DeprecatedPropertySeparatorPolicy extends WarnID;
forceConstruction(DeprecatedPropertySeparatorPolicy)
+ case object EncodingErrorPolicyError extends WarnID;
forceConstruction(EncodingErrorPolicyError)
case object EscapeSchemeRefUndefined extends WarnID;
forceConstruction(EscapeSchemeRefUndefined)
case object FacetExplicitLengthOutOfRange extends WarnID;
forceConstruction(FacetExplicitLengthOutOfRange)
case object InconsistentLengthKind extends WarnID;
forceConstruction(InconsistentLengthKind)
diff --git
a/daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/DFDL_part2_attributes.xsd
b/daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/DFDL_part2_attributes.xsd
index ae54ee632..38f1878e8 100644
---
a/daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/DFDL_part2_attributes.xsd
+++
b/daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/DFDL_part2_attributes.xsd
@@ -50,6 +50,7 @@
<xsd:attribute name="utf16Width" type="dfdl:UTF16WidthEnum" />
<xsd:attribute name="ignoreCase" type="dfdl:YesNoEnum" />
<xsd:attribute name="choiceBranchKey" type="dfdl:ListOfDFDLStringLiteral" />
+ <xsd:attribute name="textBiDi" type="dfdl:YesNoEnum"/>
<!-- Added to DFDL -->
<xsd:attribute name="encodingErrorPolicy"
type="dfdl:EncodingErrorPolicyEnum"/>
@@ -67,6 +68,7 @@
<xsd:attribute name="encodingErrorPolicy"
type="dfdl:EncodingErrorPolicyEnum"/>
<xsd:attribute name="ignoreCase" type="dfdl:YesNoEnum" />
<xsd:attribute name="choiceBranchKey" type="dfdl:ListOfDFDLStringLiteral"
/>
+ <xsd:attribute name="textBiDi" type="dfdl:YesNoEnum"/>
</xsd:attributeGroup>
<!-- 12.1 Aligned Data -->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services