Imported from previous forum
[ original email was from Mikael Brännström - m.brannstrom@ngm.se ]
Hi!
How is a static template reference encoded?
In section 6.4 in the spec it is said that a dynamic template ref is encoded as a segment, but I can’t find anything about the static template ref.
I have the following templates (id is template id).
How are the following two messages encoded? Dictionaries are reset before each message.
-
Template2: (A=4, B=5)
-
Template3 (templateRef is Template1): (A=4, B=5)
/Mikael
A static template reference has no specific encoding in the stream. It just specifies that processing should continue according to the referenced template and then return to the point after the reference.
In most cases you can think of it as syntactically replacing the reference with the instructions of the referred template.
The relevant piece of the spec is section 6.4:
“A static reference specifies that processing should continue with the referred template as the current template. A static reference does not imply that there is a presence map or template identifier in the stream. It is a dynamic error [ERR D8] if no template exists with the specified name.”
“When processing reaches the end of the referred static or dynamic template, it continues at the point after the referring instruction and the current template is restored.”
Your examples would be encoded as
111 2 4 5
PMAP TID A B
11 3 11 1 4 5
PMAP TID PMAP TID A B
/David
Hi!
How is a static template reference encoded?
In section 6.4 in the spec it is said that a dynamic template ref is
encoded as a segment, but I can’t find anything about the static
template ref.I have the following templates (id is template id).
How are the following two messages encoded? Dictionaries are reset
before each message.
Template2: (A=4, B=5)
Template3 (templateRef is Template1): (A=4, B=5)
/Mikael