diff --git a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala index a4ec9f80aa..165d48a4eb 100644 --- a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala +++ b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/ByHandMixins.scala @@ -451,7 +451,7 @@ trait TextStandardExponentRepMixin extends PropertyMixin { lazy val textStandardExponentRep: Found = { val tsec = getPropertyOption("textStandardExponentCharacter") - val tser = getPropertyOption("textStandardExponentRep") + val tser = getPropertyOption("textStandardExponentRep", expressionAllowed = true) (tsec, tser) match { case (Some(tsecStr), Some(tserStr)) => { SDW( diff --git a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala index dd1aa9d4fb..dddab9950a 100644 --- a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala +++ b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala @@ -265,8 +265,11 @@ trait FindPropertyMixin extends PropTypes { * * See JIRA DFDL-506. */ - final def getPropertyOption(pname: String): Option[String] = { - val lookupRes = findPropertyOption(pname) + final def getPropertyOption( + pname: String, + expressionAllowed: Boolean = false + ): Option[String] = { + val lookupRes = findPropertyOption(pname, expressionAllowed) val res = lookupRes match { case Found(v, _, _, _) => Some(v) case _ => None diff --git a/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/PropertyGenerator.scala b/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/PropertyGenerator.scala index 69af3c4e3f..695c9ab3db 100644 --- a/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/PropertyGenerator.scala +++ b/daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/PropertyGenerator.scala @@ -275,7 +275,15 @@ class PropertyGenerator(arg: Node) { "separatorSuppressionPolicy", "textOutputMinLength", "textStandardExponentCharacter", - "textStandardExponentRep" + "textStandardExponentRep", + "textStandardInfinityRep", + "textStandardNaNRep", + "textStandardZeroRep", + "nilValue", + "textStringPadCharacter", + "textNumberPadCharacter", + "textBooleanPadCharacter", + "textCalendarPadCharacter" ) val exclusions = notFormatProperties ++ notScopedFormatProperties ++ excludedBecauseDoneByHand @@ -454,14 +462,6 @@ trait CurrencyMixin extends PropertyMixin { "occursCount", "inputValueCalc", "outputValueCalc", - "textStandardInfinityRep", - "textStandardNaNRep", - "textStandardZeroRep", - "nilValue", - "textStringPadCharacter", - "textNumberPadCharacter", - "textBooleanPadCharacter", - "textCalendarPadCharacter", "calendarLanguage", "choiceDispatchKey" ) @@ -642,12 +642,16 @@ object Currency { */ def generateNonEnumStringPropInit(propName: String) = { val template = - """registerToStringFunction(()=>{getPropertyOption("currency") match { + """registerToStringFunction(()=>{getPropertyOption("currency", expressionAllowed) match { case None => "" case Some(value) => "currency='" + value.toString + "'" } })""" - val res = template.replaceAll("currency", propName) + val expressionAllowStr = excludeRuntimeProperties(propName).toString + val res = + template + .replaceAll("currency", propName) + .replaceAll("expressionAllowed", expressionAllowStr) res } diff --git a/daffodil-propgen/src/test/scala/org/apache/daffodil/propGen/TestPropertyGenerator.scala b/daffodil-propgen/src/test/scala/org/apache/daffodil/propGen/TestPropertyGenerator.scala index 352ebed09c..bea0e4faf9 100644 --- a/daffodil-propgen/src/test/scala/org/apache/daffodil/propGen/TestPropertyGenerator.scala +++ b/daffodil-propgen/src/test/scala/org/apache/daffodil/propGen/TestPropertyGenerator.scala @@ -69,11 +69,13 @@ class TestPropertyGenerator { assertTrue(mx.contains("""LengthKindMixin""")) assertTrue(mx.contains("""def lengthPropertiesAGInit(): Unit = {""")) assertTrue( - mx.contains("""registerToStringFunction(()=>{getPropertyOption("lengthPattern") match { + mx.contains( + """registerToStringFunction(()=>{getPropertyOption("lengthPattern", false) match { case None => "" case Some(value) => "lengthPattern='" + value.toString + "'" } - })""") + })""" + ) ) } diff --git a/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml b/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml index 69f99fa317..8093dcfa88 100644 --- a/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml +++ b/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml @@ -3711,7 +3711,8 @@ + description="Parse a double with dynamic text number properties" roundTrip="false" + ignoreUnexpectedWarnings="false"> @@ -3797,7 +3798,8 @@ + description="Parse a double with a case insensitive exp" roundTrip="false" + ignoreUnexpectedWarnings="false">