我有这个xsd
<xs:complexType name="ShapeLine">
<xs:annotation>
<xs:documentation>
ShapeLine - the line between two shapes
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="archimate:Line" >
<xs:attribute name="category" type="xs:string" use="required">
</xs:attribute>
<xs:attribute name="source" type="xs:IDREF" use="required" />
<xs:attribute name="target" type="xs:IDREF" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Shape">
<xs:annotation>
<xs:documentation>
Shape object
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="archimate:ViewNodeType" >
<xs:attribute name="shapeId" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
shapeId contains the id of the shape
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name_internal" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
name_internal contains the name_internal of the shape
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
这是我需要验证的 xml:
<views>
<diagrams>
<view identifier="id-7b98c8ec-243a-49fb-b6b0-baa68c95badb">
<name xml:lang="EN">helloe</name>
<node xsi:type="q1:Shape" identifier="id-1d599237-
76af-4fc7-8d9a-c4356c3b2137" x="10" y="30" w="1" h="1" name_internal="BD_shapes_av_Box"
shapeId="5da9cedd0c0ba649f8cae72e" angle="0" isgroup="False" alignment="" textalign="0" size="72 72">
</node>
<node xsi:type="q2:Shape" identifier="id-76efea7a-6cf3-4cf0-bbd4-e36597c0653b" x="454" y="54" w="1" h="1" name_internal="BD_shapes_av_Two sided arrow" shapeId="5dad549f0c0ba639c4a5a3ac" angle="0" isgroup="False" alignment="" textalign="0" size="72 30,476">
</node>
<connection xsi:type="q3:ShapeLine" identifier="id-4ab26cbf-509b-4657-b066-1a676a2773eb" source="id-1d599237-76af-4fc7-8d9a-c4356c3b2137" target="id-76efea7a-6cf3-4cf0-bbd4-e36597c0653b" category="line_dottednoarrows">
<sourceAttachment x="82" y="66" />
<targetAttachment x="454" y="69" />
</connection>
</view>
</diagrams>
我需要创建一个 xsd 验证,以便仅在 Shape 类型的对象之间允许使用 ShapeLine。这可以在xsd中实现吗?我对 xsd-s 还很陌生,因此感谢您提供任何帮助。