[DFDL-WG] DFDL infoset and hexBinary

Mike Beckerle beckerle at us.ibm.com
Fri Nov 16 15:55:04 CST 2007


Let me start answering my own question by way of these two definitions 
found in the XSD spec:

The ·value space· of hexBinary is the set of finite-length sequences of 
binary octets. 

The ·value space· of base64Binary is the set of finite-length sequences of 
binary octets. 

Note that the value of these is not some sort of encoded string form. 
I.e., hexBinary values do not involve characters 0-9A-F, rather. It's the 
octets that are the value.

To me this means that hexBinary and base64Binary are really identical in 
DFDL, except if we provide some sort of expressions for converting them 
to/from strings in that case the conversions are different and 
produce/consume different strings. 

...mike





Mike Beckerle/Worcester/IBM at IBMUS 
Sent by: dfdl-wg-bounces at ogf.org
11/16/2007 04:23 PM

To
dfdl-wg at ogf.org
cc

Subject
[DFDL-WG] DFDL infoset and hexBinary







What is the DFDL infoset value for a hexBinary type element? 

Our doc says an element of type hexBinary has a value member in the 
infoset whose type is a hexBinary, but what is a hexBinary anyway? 

Consider this 12 bytes of data, dumped here as hex: 
003100320033004100420043 

If that's a string in UTF-16BE encoding, it looks like "123ABC" 

It is 12 bytes long. 

Suppose we describe this using this DFDL: 

<element name="a" type="hexBinary" length='12'  /> 

As I understand it, this is correct XSD in that the length of a hexBinary 
is always specified as the number of 'octets' of the binary data, not 
characters. 

Now, the contents of the basic XML infoset for an element matching this 
schema are these 24 characters:  "003100320033004100420043". This is 
because the XML infoset has no idea what this string is because it is not 
schema aware. 

An XML document corresponding to this might look like: 

<! xml version='1.0' encoding="UTF-16BE" !> 
<a>003100320033004100420043</a> 

So, the question is...... 

What are the contents of the DFDL Infoset for a hexBinary like this? Same 
24 characters? or 12 'octets' of data? 

This is essentially the answer to the question "what IS a hexBinary?" or 
maybe "what is a hexBinary in the PSVI other than just a string?" 


...mikeb --
  dfdl-wg mailing list
  dfdl-wg at ogf.org
  http://www.ogf.org/mailman/listinfo/dfdl-wg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ogf.org/pipermail/dfdl-wg/attachments/20071116/c223a6c4/attachment.html 


More information about the dfdl-wg mailing list