1
내 XML 스키마에서 조건부 필수 필드를 소개하려고하지만 xs : assert가 유효하지 않음을 알리는 오류가 발생했습니다 ... 어떤 도움을 주겠습니까?XML xs :: assert 복잡한 유형
추가 정보 : 내가
<?xml version="1.0" encoding="iso-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="configuration" type="configurationType"/>
<xs:complexType name="configurationType">
<xs:sequence>
<xs:element name="application" minOccurs="1" maxOccurs="unbounded" type="appType" />
<xs:element name="command" minOccurs="1" maxOccurs="unbounded" type="commandType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="appType">
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="hostname" type="xs:string" use="required" />
<xs:attribute name="port" type="xs:positiveInteger" use="required" />
<xs:attribute name="group" type="xs:string" use="required" />
<xs:assert test="@hostname or @port != 4"/>
</xs:complexType>
<xs:complexType name="commandType">
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="target" type="xs:string" use="required" />
<xs:attribute name="parameter" type="xs:string" use="optional" />
</xs:complexType>
</xs:schema>
감사합니다. 많은 의미가 있습니다. –