How to reset XSD's element value type and save attribute?
I want to set in XSD
that Parameter
to have value only from type XML
If i replace this:
<xs开发者_C百科:element name="Parameter">
<xs:complexType mixed="true">
<xs:attribute name="Name" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
with this:
<xs:element name="Parameter">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
I loose the Name
attribute... How to set value to be only valid XML
and to save attribute Name
?
Just set the attribute definition after the sequence element.
<xs:element name="Parameter">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
精彩评论