XSD datatype for binary ASCII data for a Tag in XML

  • Thread starter shashidhar.yarlagadda
  • Start date
S

shashidhar.yarlagadda

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
 
M

Martin Honnen

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.
 
U

usenet

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/
 
J

Joseph Kesselman

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.
 
S

shashidhar.yarlagadda

S

shashidhar.yarlagadda

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.

Thanks much for the information.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top