You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "tuxji (via GitHub)" <gi...@apache.org> on 2023/06/12 21:32:40 UTC

[GitHub] [daffodil] tuxji commented on a diff in pull request #1033: Create a separate file for a portable GeneralFormat

tuxji commented on code in PR #1033:
URL: https://github.com/apache/daffodil/pull/1033#discussion_r1227259619


##########
daffodil-core/src/test/scala/org/apache/daffodil/core/api/TestDsomCompiler3.scala:
##########
@@ -73,7 +73,7 @@ class TestDsomCompiler3 {
       // Verify things still work using specified tmpDir
       //
       val Seq(schema) = sset.schemas
-      val Seq(schemaDoc, _) = schema.schemaDocuments
+      val schemaDoc = schema.schemaDocuments.head

Review Comment:
   For other reviewers, this line has been simplified to get the first schemaDoc in a more straightforward way.



##########
daffodil-lib/src/main/resources/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd:
##########
@@ -19,101 +19,17 @@
 <xs:schema xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
   xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
+  <xs:include schemaLocation="DFDLGeneralFormatBase.dfdl.xsd" />
+
   <!-- Intended for inclusion into other schemas. Has no targetNamespace on purpose -->
   <xs:annotation>
     <xs:appinfo source="http://www.ogf.org/dfdl/">
 
-      <!--
-        This set of properties should never change. It can be added to 
-        if properties are missing, but should not be changed.
-        
-        Changes should be introduced by way of defining new formats in
-        terms of this one, which override definitions. See below in 
-        the file for examples. 
-       -->
-      <dfdl:defineFormat name="GeneralFormatOriginal">

Review Comment:
   I see GeneralFormatOriginal has been moved to its own file called DFDLGeneralFormatBase.dfdl.xsd and that file included above here.



##########
daffodil-lib/src/main/resources/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd:
##########
@@ -19,101 +19,17 @@
 <xs:schema xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
   xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
+  <xs:include schemaLocation="DFDLGeneralFormatBase.dfdl.xsd" />
+
   <!-- Intended for inclusion into other schemas. Has no targetNamespace on purpose -->
   <xs:annotation>
     <xs:appinfo source="http://www.ogf.org/dfdl/">
 
-      <!--
-        This set of properties should never change. It can be added to 
-        if properties are missing, but should not be changed.
-        
-        Changes should be introduced by way of defining new formats in
-        terms of this one, which override definitions. See below in 
-        the file for examples. 
-       -->
-      <dfdl:defineFormat name="GeneralFormatOriginal">
-        <dfdl:format
-          alignment="1"
-          alignmentUnits="bytes"
-          binaryFloatRep="ieee"
-          binaryNumberCheckPolicy="lax"
-          binaryNumberRep="binary"
-          binaryCalendarEpoch="1970-01-01T00:00:00"
-          bitOrder="mostSignificantBitFirst"
-          byteOrder="bigEndian"
-          calendarCenturyStart="53"
-          calendarCheckPolicy="strict"
-          calendarDaysInFirstWeek="4"
-          calendarFirstDayOfWeek="Sunday"
-          calendarLanguage="en"
-          calendarObserveDST="yes"
-          calendarPatternKind="implicit"
-          calendarTimeZone=""
-          choiceLengthKind="implicit"
-          decimalSigned="yes"
-          documentFinalTerminatorCanBeMissing="no"
-          emptyValueDelimiterPolicy="both"
-          encodingErrorPolicy="replace"
-          encoding="US-ASCII"
-          escapeSchemeRef=""
-          fillByte="%#r20;"
-          floating="no"
-          ignoreCase="no"
-          initiatedContent="no"
-          initiator=""
-          leadingSkip="0"
-          lengthKind="implicit"
-          lengthUnits="bytes"
-          occursCountKind="implicit"
-          outputNewLine="%LF;"
-          representation="text"
-          separator=""
-          separatorPosition="infix"
-          separatorSuppressionPolicy="anyEmpty"
-          sequenceKind="ordered"
-          terminator=""
-          textBidi="no"
-          textBooleanPadCharacter="%SP;"
-          textCalendarJustification="left"
-          textCalendarPadCharacter="%SP;"
-          textNumberCheckPolicy="lax"
-          textNumberJustification="right"
-          textNumberPadCharacter="%SP;"
-          textNumberPattern="#,##0.###;-#,##0.###"
-          textNumberRep="standard"
-          textNumberRounding="explicit"
-          textNumberRoundingIncrement="0"
-          textNumberRoundingMode="roundHalfEven"
-          textOutputMinLength="0"
-          textPadKind="none"
-          textStandardBase="10"
-          textStandardDecimalSeparator="."
-          textStandardExponentRep="E"
-          textStandardGroupingSeparator=","
-          textStandardInfinityRep="Inf"
-          textStandardNaNRep="NaN"
-          textStandardZeroRep=""
-          textStringJustification="left"
-          textStringPadCharacter="%SP;"
-          textTrimKind="none"
-          trailingSkip="0"
-          truncateSpecifiedLengthString="no"
-          utf16Width="fixed"
-        />
-      </dfdl:defineFormat>
-      
       <dfdl:defineFormat name="GeneralFormat">
-        <dfdl:format ref="GeneralFormatOriginal"
+        <dfdl:format ref="GeneralFormatBase"
             emptyElementParsePolicy="treatAsEmpty"/>
       </dfdl:defineFormat>
         
-      <dfdl:defineFormat name="GeneralFormatPortable">

Review Comment:
   Likewise, I see GeneralFormatPortable has been moved to its own file called DFDLGeneralFormatPortable.dfdl.xsd.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org