【发布时间】:2012-02-07 05:00:38
【问题描述】:
给定:
<authentication password="turkey" partnerid="exam" />
如何在 XML 模式中声明此元素?
我有:
<xs:element name="authentication" type="auth_type" />
<xs:complexType name ="auth_type">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="password" type="xs:string" />
<xs:attribute name="partnerid" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
但它会允许元素有文本内容,对吗?我不想那样...
【问题讨论】: