I mentioned this in another post but i think it would be extremely useful so i will expand on the idea here.
There should be an xml element which would allow you to import/include another xml file in a template xml file. Similar to the #include C/C++ statement (or import in Java). Ideally it should include the entire file almost like copy-pasting it, and would be used at the start of a <binary_file_format> element like so:
CODE
<binary_file_format name="MP3">
<include file="some_stuff.xml"/>
<include file="more_stuff.xml"/>
<use_struct name="aStruct" expr="" type_name="STRUCT"/> <!-- Defined in "some_stuff.xml" -->
</binary_file_format>
That should be quite simple to implement as you would just copy the entire text, minus anything outside the binary_file_format element, from the included file into the currently file then parse it all. Of course, the copying would be done in memory, not the actual file on disk.
If the above is too hard or not possible then you could include a single struct definition something like this:
CODE
<include type_name="STRUCT" file="some_stuff.xml"/>
I would really like to see this done as it would make a number of things a lot easier:
* Windows Icon format, which uses bitmap format for each image resource.
* Embedded ID3 tags in MP3 and other music files.