XSD datatype for binary ASCII data for a Tag in XML

Discussion in 'XML' started by shashidhar.yarlagadda@gmail.com, Feb 26, 2008.

  1. Guest

    hi,

    hey! i am writing an XML Schema Defination where i got a sistutation
    in such way that i need to defina a tag that should hold binary data
    (ASCII data). How can i handle this sistutation? I mean what datatype
    i need to mention.
    i saw the base64Binary data type but it will not support all the ascii
    characters right? In this scenario can any one please give me a
    thought?

    Thanks much,
    Sha
     
    , Feb 26, 2008
    #1
    1. Advertising

  2. wrote:

    > hey! i am writing an XML Schema Defination where i got a sistutation
    > in such way that i need to defina a tag that should hold binary data
    > (ASCII data). How can i handle this sistutation? I mean what datatype
    > i need to mention.
    > i saw the base64Binary data type but it will not support all the ascii
    > characters right? In this scenario can any one please give me a
    > thought?


    You will need to encode the binary data for storing it in XML and then
    decode it when parsing it out of the XML.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Feb 26, 2008
    #2
    1. Advertising

  3. Guest

    On 26 Feb, 18:24, wrote:
    > hi,
    >
    > hey! i am writing an XML Schema Defination where i got a sistutation
    > in such way that i need to defina a tag that should hold binary data
    > (ASCII data). How can i handle this sistutation? I mean what datatype
    > i need to mention.
    > i saw the base64Binary data type but it will not support all the ascii
    > characters right? In this scenario can any one please give me a
    > thought?
    >
    > Thanks much,
    > Sha


    hexBinary is another alternative. It's simpler than base64Binary, but
    not as efficient. You can read about how they encode data at:

    http://www.w3.org/TR/xmlschema11-2/#hexBinary
    http://www.w3.org/TR/xmlschema11-2/#base64Binary

    Refer to the referenced IETF RFC (http://www.ietf.org/rfc/rfc3548.txt)
    to find out how base64 is encoded.

    HTH,

    Pete Cordell
    Codalogic
    For XML C++ data binding visit http://www.codalogic.com/lmx/
     
    , Feb 26, 2008
    #3
  4. How "binary" is your "binary"? (Or, to be more accurate, how ASCII is it?)

    The other approach would be to invent your own escaping system for the
    control characters (either as special elements, or as some syntax in the
    text such as the old ^C for control-C), use XML's escapes for the few
    other ASCII characters which need special handling, and let the schema
    just declare it as a string. Depending on what you're doing that might
    be significantly more compact than the base-64 solution.


    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, Feb 26, 2008
    #4
  5. Guest

    On Feb 26, 2:23 pm, wrote:
    > On 26 Feb, 18:24, wrote:
    >
    > > hi,

    >
    > > hey! i am writing an XML Schema Defination where i got a sistutation
    > > in such way that i need to defina a tag that should hold binary data
    > > (ASCII data). How can i handle this sistutation? I mean what datatype
    > > i need to mention.
    > > i saw the base64Binary data type but it will not support all the ascii
    > > characters right? In this scenario can any one please give me a
    > > thought?

    >
    > > Thanks much,
    > > Sha

    >
    > hexBinary is another alternative.  It's simpler than base64Binary, but
    > not as efficient.  You can read about how they encode data at:
    >
    > http://www.w3.org/TR/xmlschema11-2/#hexBinaryhttp://www.w3.org/TR/xmlschema11-2/#base64Binary
    >
    > Refer to the referenced IETF RFC (http://www.ietf.org/rfc/rfc3548.txt)
    > to find out how base64 is encoded.
    >
    > HTH,
    >
    > Pete Cordell
    > Codalogic
    > For XML C++ data binding visithttp://www.codalogic.com/lmx/


    Thanks much for the information.
     
    , Feb 27, 2008
    #5
  6. Guest

    On Feb 26, 3:08 pm, Joseph Kesselman <>
    wrote:
    > How "binary" is your "binary"? (Or, to be more accurate, how ASCII is it?)
    >
    > The other approach would be to invent your own escaping system for the
    > control characters (either as special elements, or as some syntax in the
    > text such as the old ^C for control-C), use XML's escapes for the few
    > other ASCII characters which need special handling, and let the schema
    > just declare it as a string. Depending on what you're doing that might
    > be significantly more compact than the base-64 solution.
    >
    > --
    > Joe Kesselman / Beware the fury of a patient man. -- John Dryden


    Thanks much for the information.
     
    , Feb 27, 2008
    #6
    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. Markus
    Replies:
    1
    Views:
    1,108
    Markus
    Nov 22, 2005
  2. shruds
    Replies:
    1
    Views:
    829
    John C. Bollinger
    Jan 27, 2006
  3. Marc Schellens
    Replies:
    8
    Views:
    3,018
    John Harrison
    Jul 15, 2003
  4. Jeff
    Replies:
    2
    Views:
    1,153
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 16, 2007
  5. Replies:
    0
    Views:
    1,050
Loading...

Share This Page