I'm seeking for an efficient way to handle xml data on a embedded device with heavily limited performance factors (RAM and CPU). XML has the advantage that it can be easily handled by computer based Software Tools. Once the data is modeled and loaded to the embedded device it remains static.
I think that binary XML-Representation is the way to go. But which conversion standard should I follow, or shall I even create something completely new?
Requirements:
- Clear Encoding rules and thus a deterministic binary format as result
- Effective Random Access to binary Data (Next Element)
- Easy access through C-Data-Structures
Example Data:
<Employee>
<Name>
<GivenName>Gaston</GivenName>
<FamilyName>Lagaffe<FamilyName>
</Name>
<innovation>
<description>Cosmo-coucou : horloge murale imitant la cabine Apollo </description>
<drawing>604</drawing>
</innovation>
<innovation>
<description>Parapluie simulateur de beau temps </description>
<drawing>648</drawing>
</innovation>
Finally the ability to easily treat this binary data with C, such as extracting data into structs etc. is the most important requirement to comply with.
struct Employee {
name *name;
innovation *inovations;
};
struct name {
char *GivenName;
char *FamilyName;
};
struct innovation {
char *Description;
int drawing;
};
Can asn1c help me with this?
Could the use of ASN.1 encoding rules do the job?
What's your experience with binary XML-data on embedded devices?