我将按如下顺序计算proceduralStep。我不确定如何实施。
XML:
<mainProcedure>
<proceduralStepAlts>
<proceduralStep/>
<proceduralStep/>
</proceduralStepAlts>
<proceduralStep/>
<proceduralStepAlts>
<proceduralStep>
<proceduralStepAlts>
<proceduralStep/>
<proceduralStep/>
</proceduralStepAlts>
</proceduralStep>
<proceduralStep/>
</proceduralStepAlts>
</mainProcedure>
对架构有效:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="mainProcedure" type="mainProcedureElemType"/>
<xs:complexType name="mainProcedureElemType">
<xs:choice maxOccurs="unbounded">
<xs:element ref="proceduralStep"/>
<xs:element ref="proceduralStepAlts"/>
</xs:choice>
</xs:complexType>
<xs:element name="proceduralStep" type="proceduralStepElemType"/>
<xs:complexType name="proceduralStepElemType">
<xs:sequence>
<xs:element ref="title"/>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element ref="proceduralStep"/>
<xs:element ref="proceduralStepAlts"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:element name="proceduralStepAlts" type="proceduralStepAltsElemType"/>
<xs:complexType name="proceduralStepAltsElemType">
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="proceduralStep"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
期望输出:1 1 2 3 3.1 3.1 3.2 3 4
为什么需要输出:proceduralStepAlts 包装了多个程序步骤,该集合被认为只有“一个”,因此每个程序步骤都以相同的轮廓编号显示。