Hi team,

We have a field in EDI which is decimal type, using "," as decimal
separator. Here are some examples this value can take:

18933
56,03
4500
10249
46,923
50
166116
264,187
72,2

Ideally, when parsing this field to xml, we would need to get these values
with a "." separator (and the other way round from xml to edi, if possible,
too):

18933
56.03
4500
10249
46.923
50
166116
264.187
72.2

Before considering XSLT for this specific task (a simple character
replacement would work for us), we are trying to achieve this with the same
dfdl file we use to parse the edi file.

According to some references on the internet, there would be some specific
ways to achieve this. One I tried and failed (throws errors) is:

<xsd:element name="MeasurementValue" minOccurs="0" type="xsd:decimal"
dfdl:textStandardDecimalSeparator="," />

Also we tried fiddling with some other params such as these and it didn't
work either.

dfdl:representation="text"
dfdl:encoding="UTF-8"
dfdl:textNumberRep ="standard"
dfdl:textStandardBase="10"
dfdl:textNumberPattern="#"
dfdl:textStandardDecimalSeparator=","
dfdl:lengthKind="delimited"

I specially tried to figure out and experiment with the textNumberPattern
from the documentation, as I don't see there is a clear pattern (something
like digit digit separator digit digit).

Could you please tell us if this is actually possible using only dfdl
schema attributes? And what would be the right approach? We are using
version 3.0.0.

Thank you in advance.

Reply via email to