Store a binary column in XML

Discussion in 'XML' started by Stoggers, Jul 22, 2005.

  1. Stoggers

    Stoggers Guest

    Hi,

    I have the following requirement:

    Extract binary data from column in RDBMS and store in XML.

    Process document using XSLT, retaining binary data - ie if x'00 was in
    the column then x'00 should be output by XSLT.

    Question - what is the best representation in XML for this data?

    Example of how to encode and/or transform would be appreciated.

    Thanks,

    Mike.
    Stoggers, Jul 22, 2005
    #1
    1. Advertising

  2. Stoggers wrote:


    > I have the following requirement:
    >
    > Extract binary data from column in RDBMS and store in XML.
    >
    > Process document using XSLT, retaining binary data - ie if x'00 was in
    > the column then x'00 should be output by XSLT.


    XML does not allow the unicode character with codepoint 0 so you can't
    have that character in your XML or output it with XSLT.

    > Question - what is the best representation in XML for this data?


    You could base64 encode the binary data, that is a format XML can then
    store.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jul 22, 2005
    #2
    1. Advertising

  3. Stoggers

    Stoggers Guest

    Hi,

    Many thanks for the prompt response.

    I had seen some references to base64 - do you have an example or can
    you point me to an example where it has been used to store binary
    data?

    Also, is there some processing in XSLT that would convert back to
    binary? The output type would be text so I can't see a problem with
    having embedded binary data.

    Thanks,

    Mike.
    Stoggers, Jul 22, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UnVkeQ==?=

    to store or not to store an image

    =?Utf-8?B?UnVkeQ==?=, Mar 29, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    634
    =?Utf-8?B?UnVkeQ==?=
    Mar 30, 2005
  2. Replies:
    3
    Views:
    1,802
  3. Universal
    Replies:
    1
    Views:
    593
    Lionel B
    Apr 8, 2005
  4. Universal
    Replies:
    0
    Views:
    452
    Universal
    Apr 8, 2005
  5. =?Utf-8?B?ZGF2aWQ=?=

    How to store/retrieve binary data in/from SQL server DB?

    =?Utf-8?B?ZGF2aWQ=?=, Jul 6, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    10,127
    sloan
    Jul 7, 2006
Loading...

Share This Page