Example: you declare element1 with the required attribute (because it requires it), after that, you declare element2 without the required attribute because it does not need it on your application... so the solution would be to remove the 'required' to 'opcional'
the thing is: how to make a difference on the same element that sometimes will require an attribute or not? (depending on your app)... is it even possible?
<xs:element name="DataSink" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:ID" use="required">
<xs:annotation>
<xs:documentation>unique name of the data sink used also in code generation</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="timer" use="required">
<xs:annotation>
<xs:documentation>timer for datasink</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
for example, in the last code block, 'timer' is required for DataSink element, but some Datasinks I need in my app do not required the attribute, so I do not declare it on my XML and it throws the exception
No comments:
Post a Comment