我正在创建一些架构。
我的架构结构看起来像这样。
Schema 1(Embedded schema):它有两个字段: 1.select:Drop Down 允许两个值“Heading”和“Title” 2.text
模式2:它有以下字段;
1.First--of Type Schema 1: As a field. Max occurrence is 4
主架构的来源如下所示:
<xsd:schema elementFormDefault="qualified" xmlns:tcmi="http://www.tridion.com/ContentManager/5.0/Instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.tridion.com/ContentManager/5.0/Instance"></xsd:import>
<xsd:annotation>
<xsd:appinfo>
<tcm:Labels xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<tcm:Label ElementName="select" Metadata="false">select</tcm:Label>
<tcm:Label ElementName="text" Metadata="false">text</tcm:Label>
</tcm:Labels>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType name="Content">
<xsd:sequence>
<xsd:element name="select" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:appinfo>
<tcm:ExtensionXml xmlns:tcm="http://www.tridion.com/ContentManager/5.0"></tcm:ExtensionXml>
<tcm:Size xmlns:tcm="http://www.tridion.com/ContentManager/5.0">1</tcm:Size>
<tcm:listtype xmlns:tcm="http://www.tridion.com/ContentManager/5.0">select</tcm:listtype>
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:normalizedString">
<xsd:enumeration value="Heading"></xsd:enumeration>
<xsd:enumeration value="Title"></xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="text" minOccurs="1" maxOccurs="1" type="tcmi:MultiLineText">
<xsd:annotation>
<xsd:appinfo>
<tcm:ExtensionXml xmlns:tcm="http://www.tridion.com/ContentManager/5.0"></tcm:ExtensionXml>
<tcm:Size xmlns:tcm="http://www.tridion.com/ContentManager/5.0">2</tcm:Size>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
这个模式在主模式中被称为“字段”——首先
<xsd:schema elementFormDefault="qualified" targetNamespace="some name space" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="some name space" xmlns:tcmi="http://www.tridion.com/ContentManager/5.0/Instance">
<xsd:import namespace="http://www.tridion.com/ContentManager/5.0/Instance" schemaLocation="location.xsd"></xsd:import>
<xsd:include schemaLocation="Schema 1 location"></xsd:include>
<xsd:annotation>
<xsd:appinfo>
<tcm:Labels xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<tcm:Label ElementName="First" Metadata="false">First</tcm:Label>
</tcm:Labels>
</xsd:appinfo>
</xsd:annotation>
<xsd:element name="Content">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="First" minOccurs="1" maxOccurs="4" type="Content">
<xsd:annotation>
<xsd:appinfo>
<tcm:ExtensionXml xmlns:tcm="http://www.tridion.com/ContentManager/5.0"></tcm:ExtensionXml>
<tcm:EmbeddedSchema xlink:href="Schema 1 location" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xlink:title="abcd"></tcm:EmbeddedSchema>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
“First”字段遵循 Schema 1。所以反过来它有 2 个字段。我的需要是因为“第一”字段的出现次数为 4。我还想再应用一个条件。
条件:
1.No Of occurrence of the "First" is 4.
2. As Schema 1 has drop down to select values "Heading" and "Title".
I want to restrict that out of 4 occurrence of "First",
Heading can occur Maximum 2 times and Title can occur maximum of 2 two times.
任何人都可以帮助如何实现这一目标。