Re: [xml] Binary data in ATTRIBUTE
- From: Tim Van Holder <tim vanholder anubex com>
- To: Bipin Mistry <bpnmistry 30gigs com>
- Cc: xml gnome org
- Subject: Re: [xml] Binary data in ATTRIBUTE
- Date: Fri, 30 Jun 2006 11:17:31 +0200
Bipin Mistry wrote:
seems that some thing has messed up my example as it was XML kind blocks.
"some thing"= a mail client set up to send HTML mails instead of plain
text, which is something to avoid in the first place.
can I get infor about how to put Binary data in Attribute value.
I have come accross many functions in the xmlorg which deals with binary
data, but all of them are used to write data in COMMENT / CDATA part not
the ATTRIB part.
Most typically, you would encode the data using base64 and put that in
the attribute. As Daniel says this tends to indicate a very broken design.
So while
<node attr="binary-data-in-base-64"/>
is possible,
<node>
<attr encoding="base64">binary-data-in-base-64</attr>
<other-attr>raw-binary-data-with-entities-as-needed</other-attr>
</node>
is a much better design. Attributes are intended for _attributes_, not
data (if a class in your program has 'foo' as a member, then an XML
representation should typically have 'foo' as a sub-element and not an
attribute).
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]