3.1.4.7.4 BinXml Type

The BinXml type MUST be used for values that are themselves BinXml encoding of XML fragments or TemplateInstances. This allows embedding of TemplateInstances.

The byte length for the value specifies the length of the BinXml fragment, up to and including its EOF token.

This type MUST only be used when substituting into element content. For example, given the following template instance.

Text

Binary

0C

<InnerTemplate>

01 InnerTemplate 02

<PropA> %1 </PropA>

01 PropA 02 05 0D 00 04

<PropB> %2 </PropB>

01 PropB 02 05 0D 01 04

</InnerTemplate>

04 00

02 01 04 01 04

63 65 00

And the following outer template definition.

Text

Binary

<OuterTemplate>

01 OuterTemplate 02

<PropA> %1 </PropA>

01 PropA 02 05 0D 00 04

<PropB> %2 </PropB>

01 PropB 02 05 0D 01 04

</OuterTemplate>

If the set of values for the outer template instance is the BinXml for InnerTemplate TemplateInstance, and the UINT8 value is 0x67, the resultant BinXml is the following.

 0C
 01 OuterTemplate 02
 01 PropA 02 05 0D 00 04 
 01 PropB 02 05 0D 01 04
 04 00 
 02 30 21 01 04           <- value spec for Outer Template
 0C
 01 InnerTemplate 02
 01 PropA 02 05 0D 00 04 
 01 PropB 02 05 0D 01 04     
 04 00 
 02 01 04 01 04           <- value spec for inner template
 63 65 00
 67 00

Note the value spec for the Inner Template. The template is 0x30 long, and is of type 0x21 ("BinXmlType"). It is followed by one UINT8 value.