Dictionary scope.

Imported from previous forum

Can someone tell me if my assumption about dictionary scopes based on the following example.

(template name=“temp1” dictionary=“MyDictionary”)
(typeRef = “TypeRef1”)
(string name=“field1” id=“1128”)
(copy value=“123” dictionary= “template”/)
(/string)
(string name=“field2” id=“35”)
(copy value = “123” dictionary = “type”/)
(/string)
(string name=“field3” id=“49”)
(copy value=“123” dictionary=“MyDictionary” key = 123 /)
(/string)
(string name=“field4” id=“409”)
(copy value=“123” key = 123 /)
(/string)
(sequence name=“seq1” id=10)
(typeRef = “TypeRef2”)
(string name=“field1” id=“1128”)
(copy value=“123” dictionary= “template”/)
(/string)
(string name=“field2” id=“35”)
(copy value = “123” dictionary = “type”/)
(/string)
(string name=“field3” id=“49”)
(copy value=“123” dictionary=“MyDictionary” key = 123 /)
(/string)
(string name=“field4” id=“409”)
(copy value=“123” key = 123 /)
(/string)
(/sequence)
(templateRef name = temp2)
(template)

(template name=“temp2”)
(typeRef = “TypeRef1”)
(string name=“field1” id=“1128”)
(copy value=“123” dictionary= “template”/)
(/string)
(string name=“field2” id=“35”)
(copy value = “123” dictionary = “type”/)
(/string)
(string name=“field3” id=“49”)
(copy value=“123” dictionary=“MyDictionary” key = 123 /)
(/string)
(string name=“field4” id=“409”)
(copy value=“123” key = 123 /)
(/string)
(/template)

Here is what i understood of the above example.
Temap1 template
temp1.field1 - dictionary temp1
temp1.field2 - dictionary AppTypeRef1
temp1.field3 - dictionary MyDictionary
temp1.field4 - dictionary MyDictionary

Sequence field with in Temp1
temp1.Seq1.field1 - dictionary temp1
temp1.Seq1.field2 - dictionary AppTypeRef2
temp1.Seq1.field3 - dictionary MyDictionary
temp1.Seq1.field4 - dictionary ? - IF the sequence field has a dictionary attribute say “ABC” then i would assume field4 would be in ABC

Temp2 tempalte.
temp2.field1 - dictionary temp2 or temp1 ?

temp2.field2 - dictionary AppTypeRef1 - just in case If typeref is not specified, which dictionary this would go to?

temp2.field3 - dictionary MyDictionary
temp2.field4 - dictionary Global or MyDictionary ?

Thank You
Arun.

temp1.field4 uses the global dictionary

temp1.seq1.field4 uses the global dictionary. Yes, if the sequence instruction had specified a dictionary attribute it would have been inherited by temp1.seq1.field4.

temp2.field uses the template local dictionary for temp2

temp2.field2 - if the type ref hadn’t been specified, the dictionary would have been local to the built-in Any type.

temp2.field4 uses the global dictionary

/David

Can someone tell me if my assumption about dictionary scopes based on
the following example.

(template name=“temp1” dictionary=“MyDictionary”) (typeRef = “TypeRef1”)
(string name=“field1” id=“1128”) (copy value=“123” dictionary=
“template”/) (/string) (string name=“field2” id=“35”) (copy value =
“123” dictionary = “type”/) (/string) (string name=“field3” id=“49”)
(copy value=“123” dictionary=“MyDictionary” key = 123 /) (/string)
(string name=“field4” id=“409”) (copy value=“123” key = 123 /) (/string)
(sequence name=“seq1” id=10) (typeRef = “TypeRef2”) (string
name=“field1” id=“1128”) (copy value=“123” dictionary= “template”/)
(/string) (string name=“field2” id=“35”) (copy value = “123” dictionary
= “type”/) (/string) (string name=“field3” id=“49”) (copy value=“123”
dictionary=“MyDictionary” key = 123 /) (/string) (string name=“field4”
id=“409”) (copy value=“123” key = 123 /) (/string) (/sequence)
(templateRef name = temp2) (template)

(template name=“temp2”) (typeRef = “TypeRef1”) (string name=“field1”
id=“1128”) (copy value=“123” dictionary= “template”/) (/string) (string
name=“field2” id=“35”) (copy value = “123” dictionary = “type”/)
(/string) (string name=“field3” id=“49”) (copy value=“123”
dictionary=“MyDictionary” key = 123 /) (/string) (string name=“field4”
id=“409”) (copy value=“123” key = 123 /) (/string) (/template)

Here is what i understood of the above example. Temap1 template
temp1.field1 - dictionary temp1 temp1.field2 - dictionary AppTypeRef1
temp1.field3 - dictionary MyDictionary temp1.field4 - dictionary
MyDictionary

Sequence field with in Temp1 temp1.Seq1.field1 - dictionary temp1
temp1.Seq1.field2 - dictionary AppTypeRef2 temp1.Seq1.field3 -
dictionary MyDictionary temp1.Seq1.field4 - dictionary ? - IF the
sequence field has a dictionary attribute say “ABC” then i would assume
field4 would be in ABC

Temp2 tempalte. temp2.field1 - dictionary temp2 or temp1 ?

temp2.field2 - dictionary AppTypeRef1 - just in case If typeref is not
specified, which dictionary this would go to?

temp2.field3 - dictionary MyDictionary temp2.field4 - dictionary Global
or MyDictionary ?

Thank You Arun.

My understanding was temp1.field4 would use “MyDictionary” by inheritance.

temp1.field4 uses the global dictionary

temp1.seq1.field4 uses the global dictionary. Yes, if the sequence
instruction had specified a dictionary attribute it would have been
inherited by temp1.seq1.field4.

temp2.field uses the template local dictionary for temp2

temp2.field2 - if the type ref hadn’t been specified, the dictionary
would have been local to the built-in Any type.

temp2.field4 uses the global dictionary

/David

Can someone tell me if my assumption about dictionary scopes based on
the following example.

(template name=“temp1” dictionary=“MyDictionary”) (typeRef =
“TypeRef1”) (string name=“field1” id=“1128”) (copy value=“123”
dictionary= “template”/) (/string) (string name=“field2” id=“35”)
(copy value = “123” dictionary = “type”/) (/string) (string
name=“field3” id=“49”) (copy value=“123” dictionary=“MyDictionary” key
= 123 /) (/string) (string name=“field4” id=“409”) (copy value=“123”
key = 123 /) (/string) (sequence name=“seq1” id=10) (typeRef =
“TypeRef2”) (string name=“field1” id=“1128”) (copy value=“123”
dictionary= “template”/) (/string) (string name=“field2” id=“35”)
(copy value = “123” dictionary
= “type”/) (/string) (string name=“field3” id=“49”) (copy value=“123”
dictionary=“MyDictionary” key = 123 /) (/string) (string name=“field4”
id=“409”) (copy value=“123” key = 123 /) (/string) (/sequence)
(templateRef name = temp2) (template)

(template name=“temp2”) (typeRef = “TypeRef1”) (string name=“field1”
id=“1128”) (copy value=“123” dictionary= “template”/) (/string)
(string name=“field2” id=“35”) (copy value = “123” dictionary =
“type”/) (/string) (string name=“field3” id=“49”) (copy value=“123”
dictionary=“MyDictionary” key = 123 /) (/string) (string name=“field4”
id=“409”) (copy value=“123” key = 123 /) (/string) (/template)

Here is what i understood of the above example. Temap1 template
temp1.field1 - dictionary temp1 temp1.field2 - dictionary AppTypeRef1
temp1.field3 - dictionary MyDictionary temp1.field4 - dictionary
MyDictionary

Sequence field with in Temp1 temp1.Seq1.field1 - dictionary temp1
temp1.Seq1.field2 - dictionary AppTypeRef2 temp1.Seq1.field3 -
dictionary MyDictionary temp1.Seq1.field4 - dictionary ? - IF the
sequence field has a dictionary attribute say “ABC” then i would
assume field4 would be in ABC

Temp2 tempalte. temp2.field1 - dictionary temp2 or temp1 ?

temp2.field2 - dictionary AppTypeRef1 - just in case If typeref is not
specified, which dictionary this would go to?

temp2.field3 - dictionary MyDictionary temp2.field4 - dictionary
Global or MyDictionary ?

Thank You Arun.

Ah, you’re right, I was fooled by all the parenthesis :slight_smile:

/David

My understanding was temp1.field4 would use “MyDictionary” by
inheritance.

temp1.field4 uses the global dictionary

temp1.seq1.field4 uses the global dictionary. Yes, if the sequence
instruction had specified a dictionary attribute it would have been
inherited by temp1.seq1.field4.

temp2.field uses the template local dictionary for temp2

temp2.field2 - if the type ref hadn’t been specified, the dictionary
would have been local to the built-in Any type.

temp2.field4 uses the global dictionary

/David

Hi there,

I realize this is an old post but there is one point in here I would like to clarify.

David states that in this example the field “temp1.seq1.field4” uses the global dictionary. I am trying to see why it would not inehrit the default dictionary attribute from the enclosing template (i.e. MyDictionary)

The FAST 1.1 spec states:

“The dictionary name is specified by the dictionary attribute on the field operator element or where allowed by the schema on ancestor elements. If there are more than one dictionary attribute in the ancestry, the attribute of the nearest element applies. If the attribute is not specified, the global dictionary is used.”

What is meant here by “where allowed by the schema”? What parent element types can a child element inherit the dictionary from (candidates would appear to be template, sequence and group) and what prevents dictionary attribute inheritance traversing all the way up to the root if necessary?

Regards

Adam

Ah, you’re right, I was fooled by all the parenthesis :slight_smile:

/David

My understanding was temp1.field4 would use “MyDictionary” by
inheritance.

temp1.field4 uses the global dictionary

temp1.seq1.field4 uses the global dictionary. Yes, if the sequence
instruction had specified a dictionary attribute it would have been
inherited by temp1.seq1.field4.

temp2.field uses the template local dictionary for temp2

temp2.field2 - if the type ref hadn’t been specified, the dictionary
would have been local to the built-in Any type.

temp2.field4 uses the global dictionary

/David