Figure Field Codes/Captions in RPE Templates
I'm trying to create captions for figures and tables of the "Table 7-1" and "Figure B-2" variety (see here). In Word, I can easily do what I need to by creating a field with nested codes that looks something like this (where the brackets denote the beginning/end of the fields):
{ QUOTE { IF { STYLEREF "Heading 7" \p } = "above" { STYLEREF "Heading 7" \s } { STYLEREF "Heading 1" \s } } }
For some context, “Heading 7” is the style used for the top level of the appendices, and “Heading 1” is the style used for top level section numbers. There are other Word-specific technical reasons for using headings 7–9 for appendices, but I won’t go into that here.
It doesn't appear that I can nest the field blocks in RPE, and when I attempted to insert the special characters that those brackets represent (0x13 and 0x15, respectively), I can’t save the template because those are invalid XML characters (since the template is an XML document). Replacing them with the character entities  (or /) doesn't work, as the ampersand is implicitly/silently replaced with "&".
Is there a way in RPE to nest the field codes (as shown above), or a more efficient way to accomplish this?
I have solved the problem by using multiple variables and scripts in RPE, but it doesn't seem to be the most efficient way, if I'm running three extra scripts every loop through the template.
<o:p> </o:p>