Reputation: 2579
I'm working with an XML schema that contains abstract element definitions, such as
<element name="AbstractX" type="some:Type" abstract="true"/>
When loading this schema in an XmlSchemaSet
, I can find this element in its GlobalElements
and see that it has the IsAbstract
property set to true
. So far so good.
However, this element is also referenced in a type like this
<complexType name="ReferencingX">
<complexContent>
<extension base="some:otherBaseType">
<sequence>
<element ref="some:AbstractX"/>
</sequence>
</extension>
</complexContent>
</complexType>
In the parsed XmlSchemaSet, when I navigate to the element through the complex type definition, it has IsAbstract
set to false
.
Is there some reason for that, or is it a bug in System.Xml.Schema
?
(I've simplified the XSD for the sake of brevity, the schema in question is AIXM)
Upvotes: 2
Views: 96
Reputation: 21638
No, it is not a bug.
What you're looking at in your code is a reference to an (abstract) element; references cannot be marked abstract (section 3.3.2 XML Schema Part 1, abstract is applicable only when the schema is the parent of the element).
You simply need to:
This should address your problem.
Upvotes: 1