[xsd-users] base64_binary compression

Andrej Vasilj andrej_vasilj at hotmail.com
Wed Sep 24 12:52:39 EDT 2014


I managed to follow the instructions and modify the base64_binary element. I have it working perfectly, thanks for the help!

> Date: Mon, 22 Sep 2014 07:28:19 +0200
> From: boris at codesynthesis.com
> To: andrej_vasilj at hotmail.com
> CC: xsd-users at codesynthesis.com
> Subject: Re: [xsd-users] base64_binary compression
> 
> Hi Andrej,
> 
> Andrej Vasilj <andrej_vasilj at hotmail.com> writes:
> 
> > I just started using xsd and I am really enjoying it.
> 
> Thanks, glad to hear that!
> 
> 
> > However, in the mzML format I am currently working with there is a
> > base64_binary entry which I would like to compress (either with
> > zlib or something else). I do not immediately see how I can
> > accomplish this. Does anybody know how?
> > 
> > When I create an instance of the binary_type, XSD automatically
> > encodes my double * array to base64, and then automatically
> > serializes it into the xml output. Is there anyway to intervene
> > in this process and provide the already compressed base64 data?
> 
> You can accomplish this pretty easily with type customization. See
> the C++/Tree Mapping Customization Guide:
> 
> http://wiki.codesynthesis.com/Tree/Customization_guide
> 
> As well as the examples in the examples/cxx/tree/custom/ directory.
> 
> There are two ways that you can approach this: If it is all the
> base64_binary elements/attributes in your vocabulary that you
> want to compress, then you would customize base64_binary itself.
> 
> If, however, it is only a specific element/attribute of the
> base64_binary type that you want compressed, then your would
> customize the complex type that contains this element/attribute
> and compress the data in the serialization operator and de-
> compress it in the parsing constructor.
> 
> Finally, there is the 'compression' example that shows how
> to compress the whole document with zlib.
> 
> Boris
 		 	   		  


More information about the xsd-users mailing list