This was probably one of the most confusing aspects of DFDL for me as well. The only scoping of attribute's is that a schema file's format annotation applies as the default format for any type in said file.
What goes on with deliminators is slightly different. When you define a dfdl:seperator on an xs:sequence, that property is not actually inherited by any of the elements, but is just a property of the sequence itself. To see this, consider nested sequences. If the outer sequence defines a seperator of ",", and the inner sequence does not, then a "," encountered while parsing the inner sequence will not seperate elements of the inner sequence. It may, however, terminate the inner sequence to seperate elements of the outer sequence. There is certainly something scopey going on here, but it is not elements inheriting attribures from parents. Brandon T. Sloane Associate, Services [email protected] | tresys.com ________________________________ From: Costello, Roger L. <[email protected]> Sent: Saturday, November 23, 2019 9:07:50 AM To: [email protected] <[email protected]> Subject: What is the scope of a property specified on an XML Schema item (element declaration, xs:sequence, etc.)? Hi Folks, Today, I learned that in the below snippet, the dfdl:encoding assigned on the <csv> element only applies to the <csv> element, not to its children. <xs:element name="csv" dfdl:encoding="{$fieldencoding}"> What is the general rule? Is it: Any property assigned on an element declaration applies only to the element and not to its children? But, but, but, … a dfdl:separator property assigned on a <xs:sequence> element applies to the children of xs:sequence. Wow, this is confusing. Sometimes the properties assigned on an XML Schema item is inherited by the item’s children, sometimes not. Isn’t that confusing? /Roger
