如何将xsd元素作为必需元素

时间:2014-05-27 13:13:14

标签: xsd

在下面的xsd中,我想将EDI_DC元素设为必需元素。我尝试使用minOccurs="1"nillable="false",但它无效。

请在此处建议我使用此元素作为强制性内容。

XSD:

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
            xmlns:tns="http://TargetNamespace.com/sdg"
            targetNamespace="http://www.oracle.com/ias/processconnect"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            nxsd:stream="chars"
            nxsd:version="NXSD">

  <xsd:element name="Root-Element">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">

        <xsd:element name="EDI_DC"  nxsd:startsWith="EDI_DC" >
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="tabnam" 
                           type="xsd:string" 
                           nxsd:style="fixedLength"
                           nxsd:length="4" 
                           />
              <xsd:element name="mandt" 
                           type="xsd:string" 
                           nxsd:style="fixedLength"
                           nxsd:length="3" 
                           />
              <xsd:element name="docnum" 
                           type="xsd:string" 
                           nxsd:style="fixedLength"
                           nxsd:length="16" 
                           />
              <xsd:element name="docrel" 
                           type="xsd:string" 
                           nxsd:style="fixedLength"
                           nxsd:length="4" 
                           />

              <xsd:element name="EDI_DCeol" 
                           type="xsd:string"  
                           nxsd:style="terminated"
                           nxsd:terminatedBy="${eol}" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>

        <xsd:element name="E2EDL20"  nxsd:startsWith="E2EDL20">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="segnam_ver" type="xsd:string"
                           nxsd:style="fixedLength" 
                           nxsd:length="23"
                           />
              <xsd:element name="mandt" type="xsd:string" 
                           nxsd:style="fixedLength"
                           nxsd:length="3" />
              <xsd:element name="docnum" type="xsd:string" 
                           nxsd:style="fixedLength"
                           nxsd:length="16" />

              <xsd:element name="E2EDL20EOL" type="xsd:string" 
                           nxsd:style="terminated"
                           nxsd:terminatedBy="${eol}"/>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>


      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

0 个答案:

没有答案