Details
-
Question
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
2.2.1
-
None
Description
Hi there,
I am in the scenary of traversing the out-come of reading an XSD.
I am somewhat trying to simplify the output of XMLSchema, in order to have the properties (elements and attributes) mapped to DB-tables (complex types) and DB-table-columns (mayby XSD-complex, geometries for instance or other DB-complex-types or XSD-simple, string, int etc.).
I am bewildered about how attributes are to be inherited down to a complex XSD type when deriving from another XSD-type by restriction. As I have learned so far, all attributes are to be inherited by default, as opposed to element-properties of the base-type.
Is this rightly understood by me?
In my simplified model I keep track of the base-type hierarchy, and how the inheritance is defined (extension, restriction, final). For each level I have tracked all the attributes of each complex type. Do I need to "collect" base-type attributes not referenced in a current complex type, when the current complex type is deriving from a super-type by restriction?
In other words: Do XmlSchema do any automic inheritance derivations "behind the scenes", or do we have to do such on our own behalf?
As you will understand: If XmlSchema is not doing the attribute-inheriting for me, I have to do it my self. This will involve "inherit all attributes from base-type which is not mentioned in current type".
Hope my question is understandable: How to inherit attributes when deriving by restriction.
/Aron