MBTK and Daffodil - Intentioning Violating Property Scoping Rules?
(Emotions are hard to convey in email; please trust me when I say that I am writing this email with kindness and friendliness!)
In section 8 it says, "The dfdl:format annotation on the top level xs:schema declaration provides defaults for the DFDL representation properties at every DFDL-annotatable component contained in the schema document. They do not apply to any components in any included or imported schema document (these may have their own defaults)."
If I understand this, it means that when properties are defined using dfdl:format in one DFDL schema file, they are out of scope for any other DFDL schema file.
So if schema A defines some properties and includes schema B, the properties are out of scope in schema B.
Similarly, if schema A includes schema B and schema B defines some properties, the properties are out of scope in schema A.
Is that right? I think so, and I have empirically confirmed this in both tools.
Ok, so you know where this going, right? Why does the following line work?
OK. I'll bite...
Some features of DFDL take some time to understand, and some are not
perfectly described in the specification. That does make it hard for
somebody in your position because you only have the specification to go
on, As far as I'm concerned, you should feel free to raise questions like
this without apology.
In this case, neither Daffodil nor IBM DFDL is violating the (intended)
rules in the specification. The properties from the imported xsd are not
being used by a *component* in the main xsd. Instead, the 'ref' attribute
of the global format block in the main xsd is referring to a named format
block in the imported xsd. In this way, the library xsd is contributing a
wide-ranging list of default values into the global format block of the
main xsd.
I expect Steve or Mike will add some details to that...
regards,
Tim Kimber, DFDL Team,
Hursley, UK
Internet: kimbert@uk.ibm.com
Tel. 01962-816742
Internal tel. 37246742
From: "Garriss Jr., James P."
I think what you’re saying is that I’m failing to take into account this part of the schema:
xsd:annotation
Here’s what I suspect: Both MBTK and Daffodil hard-coded this as an undocumented exception to the rule. Garriss - There is no special case or undocumented exception .. It is implemented as per the spec.
Your question - How the general purpose format becomes visible to the
artifacts in the file ..
Note we have default format defined ( hilited in bold) which references
the general purpose format ; as a results any attribute defined in global
general purpose format is available to the default format and hence to all
artifacts in the current file.. This is the consistent approach and
pattern used in our implementation..
<?xml version="1.0" encoding="UTF-8"?>
participants (3)
-
Garriss Jr., James P.
-
Suman Kalia
-
Tim Kimber