Correct cannot be done. Simple type, but complex representation. Means you are 
stuck with XSD's complex types to express your format.


Means best you can do is <traffic-light><red/></traffic-light> or 
<traffic-Light><value>red</value></traffic-light>.


Thank XSD for this lovely constraint.

________________________________
From: Costello, Roger L. <[email protected]>
Sent: Wednesday, January 23, 2019 12:54:58 PM
To: [email protected]
Subject: Cannot output XML containing a single element whose value is a 
symbolic encoding of a numeric value ... do you agree?


Hello DFDL community,



My input file is a binary file.



It consists of a single byte.



The byte represents an unsigned integer.



The integer is an encoding of a traffic light color: 0 means red, 1 means 
yellow, and 2 means green. Any other value is an error.



If the input is this hex byte: 00



Then the output should be this XML:



<?xml version="1.0"?>

<traffic-light>red</traffic-light>



I just realized that this is impossible to do in DFDL. Why? Because it requires 
the use of a hidden group, which requires the use of <xs:sequence>.



Do you agree that what I want to do cannot be done with DFDL?



/Roger

Reply via email to