Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedding Binary File in XML File

Status
Not open for further replies.

bdigi

Programmer
Aug 22, 2002
1
US
Can anyone give me some helpful tips on embedding a binary file within an XML File? Also can someone give me a list of valid XML Characters ? ? ?
 
i don't think there's any proper way to embed binary into an xml document. you could try looking in to using uuencoding or base64, but this would require a uuencode/decode function on both sides. i don't think this process would use any illegal xml chars.
 
The valid characters depend on the code page you use. However, there are some characters that you just can't have in a valid XML file, lib &, <, >,&quot;,'. For these, you use some predefined macros that any XML parser should properly transcode. Basically, all the macros have the form
macro = &text;.
The above characters valid XML representation would be:
& = &amp;
< = &lt;
> = &gt;
&quot; = &quot;
... and I can't remember :-( the last ones.
However, if you want to represent a character not recognizable by a code page, you can always use its hexadecimal notation: &#xxxx;

I subscribe also to MrToms' reply on binary data issues. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top