【发布时间】:2015-10-15 21:12:30
【问题描述】:
我有一个如下所示的xml架构。这里我想实现两个复杂类型的条件,如下所示
-
ParcelNumber或Coordinates应该存在 - 如果存在
WorkArea,那么Coordinates应该是强制性的
在下面的架构中如何实现这两个条件
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xsi="http://www.w3.org/2007/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2007/XMLSchema"
attributeFormDefault="unqualified"
elementFormDefault="qualified"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.1">
<xs:sequence>
<xs:element name="WorkLocationCommunityName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:complexType>
【问题讨论】: