From: Florian R. <fl...@eb...> - 2009-06-15 10:58:27
|
Hi, due to requests for jmzml, the Java API for mzML we developed in the PRIDE team, we had to deal with the 'binary' data elements in the BinaryDataArray. The default JAXB mapping of the xsd:base64Binary type to Java results in a byte[], which seems to cause troubles when trying to convert with standard base64 algorithms as it does not produce the expected result. I had to add an extension to the mzML schema defining the binary type to be of type "text/plain" (see below), so the Java mapping would result in a String representation of the binary data instead of a byte[]. The byte[] obtained from that String can then be converted to/from base64binary without problem. The change in the schema is as follows: original: <xs:element name="binary" type="xs:base64Binary"/> modified: <xs:element name="binary" type="xs:base64Binary" xmime:expectedContentTypes="text/plain" xmlns:xmime="http://www.w3.org/2005/05/xmlmime"/> Now, I was wondering if someone else has experienced similar issues or if someone can see issues with this modification of the schema (is there a potential issue with the schema specs? or should it be defined in more detail in case there might be issues with other tools as well?). Also, I am not a expert in XML/Java mapping, so if there is an alternative/preferred way to handle this type of data, I would be happy to know about it. Thanks, Florian |