Re: [xml] Embedding images



How can I use libxml to embed a large pixmap in a file? I don't want to
use a different file for the image, I wan't to embed it in my main
document. Is that possible? How? Any documentation? What about embedding
BLOBs, like a gif file, is there any documentation/examples available?

The "standard" way to do this is to use base64 encoding, and putting the
data in the content of a tag. There is no direct support for decoding this
in XML parsers, but it's pretty easy to do manually.


Thanks for the info, can you give me a link to documentation/examples,
if any?

XML-dev's archives are full of this sort of thing, as a Google search for
"XML base64 binary" will turn up.


Thanks again! I've been doing something similar, but using hexadecimal
expressions to represent the pixels data. That means that each value from
0-65535 can ve represented by 4 bytes (0-9/A-F), while using base64 this
can be reduced to 3. However I found it problematic when I use the SAX
interface to parse the file. The charactersSAXFunc callback 
returns a string with all the character between tags, and if the string
is too long (apparently len = 1000), my program crashes. This will be the
subject of my next mail to the list, maybe someone can give me a
suggestion.
Thanks!
<ADRIAN>  





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]