2007-09-16, 23:22
This is probably more of a general XML question than XBMC specific, but I can't find and answer through google...
Is there an XML equivalent to #define in c/c++?
I've got some elements that I'd like to keep in sync without having to go through each individual file.
eg.
[HTML]<font>
<size>48</size>
</font>
<control list>
<layout height="48">
<label>
<height>48</height>
</label>
</layout>
</control>[/HTML]
but I'd like to have this (or something similar):[HTML]
<define name="MYFONTSIZE">48</define>
<font>
<size><? MYFONTSIZE ></size>
</font>
<control list>
<layout height="<? MYFONTSIZE >">
<label>
<height><? MYFONTSIZE ></height>
</label>
</layout>
</control>[/HTML]
I can't use 'includes' because they (seem to) need the appropriate tags as well as some data, in this case I'd need 3x includes, which is a bit better, but still a pain (not sure if include would work with the <layout> tag, do includes need to be a complete block? i.e. <layout height="48">..blah..</layout>, meaning I couldn't use it here anyway?)
Is there an XML equivalent to #define in c/c++?
I've got some elements that I'd like to keep in sync without having to go through each individual file.
eg.
[HTML]<font>
<size>48</size>
</font>
<control list>
<layout height="48">
<label>
<height>48</height>
</label>
</layout>
</control>[/HTML]
but I'd like to have this (or something similar):[HTML]
<define name="MYFONTSIZE">48</define>
<font>
<size><? MYFONTSIZE ></size>
</font>
<control list>
<layout height="<? MYFONTSIZE >">
<label>
<height><? MYFONTSIZE ></height>
</label>
</layout>
</control>[/HTML]
I can't use 'includes' because they (seem to) need the appropriate tags as well as some data, in this case I'd need 3x includes, which is a bit better, but still a pain (not sure if include would work with the <layout> tag, do includes need to be a complete block? i.e. <layout height="48">..blah..</layout>, meaning I couldn't use it here anyway?)