You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2020/07/30 13:31:00 UTC

[jira] [Commented] (DAFFODIL-2378) Number sign unparses in wrong part of number text: "0000000-1"

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

Mike Beckerle commented on DAFFODIL-2378:
-----------------------------------------

This "bug" may just be an undesirable behavior according to the DFDL spec. Padding occurs on one side or the other of the representation of the number. 

There is no way to specify that the pad char is "0" but "please put it between the sign and the rest of the number."

You have to specify textNumberPattern '#00000000'  to get the right behavior.

Zero-extension (not calling it padding) of numbers must be achieved using textNumberPattern not padChar, textPadKind and textOutputMinLength. 

> Number sign unparses in wrong part of number text: "0000000-1"
> --------------------------------------------------------------
>
>                 Key: DAFFODIL-2378
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2378
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 2.7.0
>            Reporter: Mike Beckerle
>            Priority: Major
>             Fix For: 3.0.0
>
>
> The unparser test case below fails.
> The output is "0000000-1" which is clearly wrong. The padding should be after the sign. 
> Interestingly same bug appears in IBM DFDL (who asked us to see if it also is in Daffodil), which suggests rather strongly this may be an issue in the ICU library.
> {code:java}
> 	<tdml:defineSchema name="dfdlwg1" elementFormDefault="unqualified">
> 		<xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
> 		<dfdl:format ref="ex:GeneralFormat" lengthKind="delimited"/>
> 		<xs:element name="r" type="ex:numeric9_custom1"/>
> 		<xs:simpleType dfdl:textNumberPattern="#0" 
>                                             dfdl:textOutputMinLength="9" dfdl:textPadKind="padChar"
> 					   dfdl:textTrimKind="padChar" name="numeric9_custom1" 
>                                            dfdl:textNumberPadCharacter="0">
> 			<xs:restriction base="xsd:decimal">
> 				<xs:totalDigits value="9"/>
> 			</xs:restriction>
> 		</xs:simpleType>
> 	</tdml:defineSchema>
> 	<tdml:unparserTestCase name="textNumberPattern1" model="dfdlwg1">
> 		<tdml:document><![CDATA[-00000001]]></tdml:document>
> 		<tdml:infoset><tdml:dfdlInfoset>
> 			<ex:r>-1</ex:r>
> 		</tdml:dfdlInfoset></tdml:infoset>
> 	</tdml:unparserTestCase>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)