Is this value a number or some byte array of length 8?
Endianness doesn't apply if it is a byte array. There's no such concept. So if you model it as hexbinary, byte order is not relevant. You will get the bytes in sequence right to left, first byte first. If it is a number (name imageBase suggests it gets offsets added to it), then I suggest you model it as a number, i.e., I recommend you model it as a littleEndian xs:Long or xs:UnsignedLong. That keeps you out of endianness hell. ________________________________ From: Costello, Roger L. <[email protected]> Sent: Friday, November 16, 2018 5:12:59 PM To: [email protected] Subject: If the input file is in littleEndian and I output as xs:hexBinary, would you use dfdl:byteOrder="littleEndian"? or bigEndian? Hello DFDL Community, I am creating a DFDL schema for exe files. Exe files are in littleEndian. One field is called imageBase. It is a long long value. (long long is 8 bytes) Would it make most sense to output that field simply as hex? If I output it as hex, would it be better to output the hex in littleEndian: <xs:element name="Image_Base_in_hex" type="xs:hexBinary" dfdl:length="8" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:byteOrder="littleEndian" /> Or, would it be better to output the hex in bigEndian: <xs:element name="Image_Base_in_hex" type="xs:hexBinary" dfdl:length="8" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:byteOrder="bigEndian" /> If I output it in bigEndian: <Image_Base_in_hex>0090000000004000</Image_Base_in_hex> it is easier to copy the hex in that element and find the hex in my hex editor. What do you recommend?
