Author |
Message
|
Sam Uppu |
Posted: Fri Dec 23, 2011 10:05 am Post subject: Cdata |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Hey Guys,
I have a question if we can use base64 data wrapped in cdata section?
Will this be a well formed xml?
Thanks
Sam |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 23, 2011 10:16 am Post subject: Re: Cdata |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sam Uppu wrote: |
I have a question if we can use base64 data wrapped in cdata section?
Will this be a well formed xml? |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Fri Dec 23, 2011 11:18 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Thanks Vitor.
I have a question on base64 and cdata.
When we do base64 encoding on data(image), is it required to wrap it in cdata after encoding?
Can I directly use it without wrapping in cdata?
Do you think of any advanges/disadv of wrapping base64 data in cdata.
Thanks
Sam |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Dec 23, 2011 11:53 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Sam Uppu wrote: |
Thanks Vitor.
I have a question on base64 and cdata.
When we do base64 encoding on data(image), is it required to wrap it in cdata after encoding?
Can I directly use it without wrapping in cdata?
Do you think of any advanges/disadv of wrapping base64 data in cdata.
Thanks
Sam |
There is an XML datatype that matches base64. There is not need to wrap it in a CDATA section.
Actually, I prefer using base64encoding especially since V7 when you could encode/decode data directly from ESQL.
The other advantage is that it is not parsed/format checked like a CDATA section thus it is more versatile. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Fri Dec 23, 2011 12:02 pm Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Thanks smdavies99.
I have encoded the image data to base64, after that I wrapped the base64 data to cdata section. I not sure if this will case any issues? RIght now I am not facing any issues when I drop it to MQ queue.
Can you let me know if there would be any issues with that? |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 23, 2011 12:08 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sam Uppu wrote: |
When we do base64 encoding on data(image), is it required to wrap it in cdata after encoding?
Can I directly use it without wrapping in cdata? |
It's not essential; there is a XML datatype that matches base64.
Sam Uppu wrote: |
Do you think of any advanges/disadv of wrapping base64 data in cdata. |
If you don't wrap it in CDATA but use the data type, you're reliant on the parsing application having access to a schema & identifying the tag as having by base64. Using CDATA indicates that it's not string, though still requires it to know how to decode the CDATA. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|