2016-09-02 12 views
1

私はXSDファイルを持っており、そのファイルを生成されたXMLファイルに対して検証する必要があります。私はたくさんのXMLファイルを作成しようとしましたが、指定されたXSDと一致するファイルはありませんでした。誰かが指定されたXSDファイルに一致する正しいXMLファイルを提案できますか?Swift XSDに対して有効なXMLファイルを作成するにはどうすればよいですか?

<?xml version="1.0" encoding="UTF-8"?> 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:info="urn:swift:xsd:appInfo" xmlns="urn:swift:xsd:fin.760.2016" targetNamespace="urn:swift:xsd:fin.760.2016" elementFormDefault="qualified"> 
    <xs:element name="Document" type="Document"/> 
    <xs:complexType name="MTMessage" abstract="true"/> 
    <xs:complexType name="ISO15022Message" abstract="true"/> 
    <xs:complexType name="SystemMessage" abstract="true"/> 
    <xs:complexType name="Sequence" abstract="true"/> 
    <xs:complexType name="Choice" abstract="true"/> 
    <xs:complexType name="MTField" abstract="true"/> 
    <xs:complexType name="ISO15022Field" abstract="true"/> 
    <xs:complexType name="QualifierGroup" abstract="true"/> 
    <xs:complexType name="Qualifier" abstract="true"/> 
    <xs:complexType name="FieldOption" abstract="true"/> 
    <xs:complexType name="ComplexDataType" abstract="true"/> 
    <xs:complexType name="ChoiceDataType" abstract="true"/> 
    <xs:complexType name="Document"> 
     <xs:sequence> 
      <xs:element name="MT760" type="MT760_Type"> 
       <xs:annotation> 
        <xs:documentation source="Name" xml:lang="EN">Guarantee/Standby Letter of Credit</xs:documentation> 
        <xs:documentation source="Definition" xml:lang="EN">Scope 
This message is sent between banks involved in the issuance of a guarantee.It is used to issue a guarantee or to request the Receiver to issue a guarantee.This message may also be used for Standby Letters of Credit.</xs:documentation> 
       </xs:annotation> 
      </xs:element> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="MT760_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTMessage"> 
       <xs:sequence> 
        <xs:element name="F27a" type="MT760_F27a_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Sequence of Total</xs:documentation> 
          <xs:documentation source="Definition" xml:lang="EN">This field specifies the number of this message in the series of messages sent for a guarantee, and the total number of messages in the series.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="F20a" type="MT760_F20a_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Transaction Reference Number</xs:documentation> 
          <xs:documentation source="Definition" xml:lang="EN">When the message is sent to issue a guarantee, this field must specify the guarantee number.When the message is sent to request the Receiver to issue a guarantee, this field must contain the reference of the request, as assigned by the Sender.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="F23a" type="MT760_F23a_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Further Identification</xs:documentation> 
          <xs:documentation source="Definition" xml:lang="EN">This field further identifies the purpose of the message.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="F30a" type="MT760_F30a_Type" minOccurs="0"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Date</xs:documentation> 
          <xs:documentation source="Definition" xml:lang="EN">When the message is sent to issue a guarantee, this field specifies the issue date of the guarantee.When the message is sent to request the Receiver to issue a guarantee, this field specifies the date of the request.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="F40a" type="MT760_F40a_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Applicable Rules</xs:documentation> 
          <xs:documentation source="Definition" xml:lang="EN">This field specifies the rules the guarantee is subject to. Unless otherwise specified in field 77C, it is also the rules the counter-guarantee is subject to.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="F77a" type="MT760_F77a_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Details of Guarantee</xs:documentation> 
          <xs:documentation source="Definition" xml:lang="EN">This field contains all terms, conditions and details of the guarantee.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="F72a" type="MT760_F72a_Type" minOccurs="0"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Sender to Receiver Information</xs:documentation> 
          <xs:documentation source="Definition" xml:lang="EN">This field contains additional information for the Receiver.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="MT760_F27a_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTField"> 
       <xs:choice> 
        <xs:element name="F27" type="F27_1_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:Tag value="27"/> 
          </xs:appinfo> 
          <xs:documentation source="Name" xml:lang="EN">Number - Total</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:choice> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="MT760_F20a_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTField"> 
       <xs:choice> 
        <xs:element name="F20" type="F20_2_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:Tag value="20"/> 
          </xs:appinfo> 
         </xs:annotation> 
        </xs:element> 
       </xs:choice> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="MT760_F23a_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTField"> 
       <xs:choice> 
        <xs:element name="F23" type="F23_50_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:Tag value="23"/> 
          </xs:appinfo> 
         </xs:annotation> 
        </xs:element> 
       </xs:choice> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="MT760_F30a_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTField"> 
       <xs:choice> 
        <xs:element name="F30" type="F30_1_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:Tag value="30"/> 
          </xs:appinfo> 
          <xs:documentation source="Name" xml:lang="EN">Date</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:choice> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="MT760_F40a_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTField"> 
       <xs:choice> 
        <xs:element name="F40C" type="F40C_2_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:Tag value="40C"/> 
          </xs:appinfo> 
          <xs:documentation source="Name" xml:lang="EN">Type - Narrative</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:choice> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="MT760_F77a_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTField"> 
       <xs:choice> 
        <xs:element name="F77C" type="F77C_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:Tag value="77C"/> 
          </xs:appinfo> 
          <xs:documentation source="Name" xml:lang="EN">Narrative</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:choice> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="MT760_F72a_Type"> 
     <xs:complexContent> 
      <xs:extension base="MTField"> 
       <xs:choice> 
        <xs:element name="F72" type="F72_162_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:Tag value="72"/> 
          </xs:appinfo> 
          <xs:documentation source="Name" xml:lang="EN">Narrative</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:choice> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="F27_1_Type"> 
     <xs:complexContent> 
      <xs:extension base="FieldOption"> 
       <xs:sequence> 
        <xs:element name="Number" type="Quantity_FIN_1En_Type"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:SepSuffix value="/"/> 
          </xs:appinfo> 
          <xs:documentation source="Name" xml:lang="EN">Number</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="Total" type="Quantity_FIN_1En_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Total</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:simpleType name="F20_2_Type"> 
     <xs:restriction base="Text_FIN_16x_Type"/> 
    </xs:simpleType> 
    <xs:simpleType name="F23_50_Type"> 
     <xs:restriction base="Text_FIN_16x_Type"/> 
    </xs:simpleType> 
    <xs:simpleType name="F30_1_Type"> 
     <xs:annotation> 
      <xs:documentation source="Name" xml:lang="EN">Date</xs:documentation> 
     </xs:annotation> 
     <xs:restriction base="DateTime_YYMMDD_Type"/> 
    </xs:simpleType> 
    <xs:complexType name="F40C_2_Type"> 
     <xs:complexContent> 
      <xs:extension base="FieldOption"> 
       <xs:sequence> 
        <xs:element name="Type" type="Code_4Ea_14_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Type</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element name="Narrative" type="Text_FIN_35x_Type" minOccurs="0"> 
         <xs:annotation> 
          <xs:appinfo> 
           <info:SepPrefix value="/"/> 
          </xs:appinfo> 
          <xs:documentation source="Name" xml:lang="EN">Narrative</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="F77C_Type"> 
     <xs:complexContent> 
      <xs:extension base="FieldOption"> 
       <xs:sequence> 
        <xs:element name="Narrative" type="Text_FIN_150M65x_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Narrative</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="F72_162_Type"> 
     <xs:complexContent> 
      <xs:extension base="FieldOption"> 
       <xs:sequence> 
        <xs:element name="Narrative" type="Text_FIN_6M35x_1_Type"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Narrative</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:simpleType name="Quantity_FIN_1En_Type"> 
     <xs:annotation> 
      <xs:appinfo> 
       <info:MetaType value="Quantity"/> 
       <info:FinFormat value="1!n"/> 
      </xs:appinfo> 
     </xs:annotation> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="1"/> 
      <xs:maxLength value="1"/> 
      <xs:pattern value="[0-9]"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="Text_FIN_16x_Type"> 
     <xs:annotation> 
      <xs:appinfo> 
       <info:MetaType value="Text"/> 
       <info:FinFormat value="16x"/> 
      </xs:appinfo> 
     </xs:annotation> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="1"/> 
      <xs:maxLength value="16"/> 
      <xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,&apos;\+ ]{1,16}"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="DateTime_YYMMDD_Type"> 
     <xs:annotation> 
      <xs:appinfo> 
       <info:MetaType value="DateTime"/> 
       <info:FinFormat value="YYMMDD"/> 
      </xs:appinfo> 
     </xs:annotation> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="6"/> 
      <xs:maxLength value="6"/> 
      <xs:pattern value="[0-9]{6}"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="Code_4Ea_14_Type"> 
     <xs:restriction base="Text_4Ea_Type"> 
      <xs:enumeration value="ISPR"> 
       <xs:annotation> 
        <xs:documentation source="Definition" xml:lang="EN">The guarantee is subject to International Standby Practices</xs:documentation> 
       </xs:annotation> 
      </xs:enumeration> 
      <xs:enumeration value="NONE"> 
       <xs:annotation> 
        <xs:documentation source="Definition" xml:lang="EN">The guarantee is not subject to any rules</xs:documentation> 
       </xs:annotation> 
      </xs:enumeration> 
      <xs:enumeration value="OTHR"> 
       <xs:annotation> 
        <xs:documentation source="Definition" xml:lang="EN">The guarantee is subject to another set of rules, which must be specified in Narrative (2nd subfield)</xs:documentation> 
       </xs:annotation> 
      </xs:enumeration> 
      <xs:enumeration value="URDG"> 
       <xs:annotation> 
        <xs:documentation source="Definition" xml:lang="EN">The guarantee is subject to the ICC Uniform Rules for Demand Guarantees</xs:documentation> 
       </xs:annotation> 
      </xs:enumeration> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="Text_FIN_35x_Type"> 
     <xs:annotation> 
      <xs:appinfo> 
       <info:MetaType value="Text"/> 
       <info:FinFormat value="35x"/> 
      </xs:appinfo> 
     </xs:annotation> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="1"/> 
      <xs:maxLength value="35"/> 
      <xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,&apos;\+ ]{1,35}"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:complexType name="Text_FIN_150M65x_Type"> 
     <xs:complexContent> 
      <xs:extension base="ComplexDataType"> 
       <xs:sequence> 
        <xs:annotation> 
         <xs:appinfo> 
          <info:Separator value="&#x0d;&#x0a;"/> 
         </xs:appinfo> 
         <xs:documentation source="Name" xml:lang="EN">Line</xs:documentation> 
        </xs:annotation> 
        <xs:element name="Line" type="Text_FIN_65x_Type" maxOccurs="150"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Line</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:complexType name="Text_FIN_6M35x_1_Type"> 
     <xs:complexContent> 
      <xs:extension base="ComplexDataType"> 
       <xs:sequence> 
        <xs:annotation> 
         <xs:appinfo> 
          <info:Separator value="&#x0d;&#x0a;"/> 
         </xs:appinfo> 
         <xs:documentation source="Name" xml:lang="EN">Line</xs:documentation> 
        </xs:annotation> 
        <xs:element name="Line" type="Text_FIN_35x_Type" maxOccurs="6"> 
         <xs:annotation> 
          <xs:documentation source="Name" xml:lang="EN">Line</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
    <xs:simpleType name="Text_4Ea_Type"> 
     <xs:annotation> 
      <xs:appinfo> 
       <info:MetaType value="Code"/> 
       <info:FinFormat value="4!a"/> 
      </xs:appinfo> 
     </xs:annotation> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="4"/> 
      <xs:maxLength value="4"/> 
      <xs:pattern value="[A-Z]{4}"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="Text_FIN_65x_Type"> 
     <xs:annotation> 
      <xs:appinfo> 
       <info:MetaType value="Text"/> 
       <info:FinFormat value="65x"/> 
      </xs:appinfo> 
     </xs:annotation> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="1"/> 
      <xs:maxLength value="65"/> 
      <xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,&apos;\+ ]{1,65}"/> 
     </xs:restriction> 
    </xs:simpleType> 
</xs:schema> 

答えて

1

を得たあなたが投稿スウィフトXSDのためoXygen XML Editorによって生成された有効なXMLインスタンスである:

<?xml version="1.0" encoding="UTF-8"?> 
<ns0:Document xmlns:info="urn:swift:xsd:appInfo" 
       xmlns:ns0="urn:swift:xsd:fin.760.2016" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="urn:swift:xsd:fin.760.2016 
            swift.xsd"> 
    <ns0:MT760> 
    <ns0:F27a> 
     <ns0:F27> 
     <ns0:Number>0</ns0:Number> 
     <ns0:Total>0</ns0:Total> 
     </ns0:F27> 
    </ns0:F27a> 
    <ns0:F20a> 
     <ns0:F20>F200</ns0:F20> 
    </ns0:F20a> 
    <ns0:F23a> 
     <ns0:F23>F230</ns0:F23> 
    </ns0:F23a> 
    <ns0:F40a> 
     <ns0:F40C> 
     <ns0:Type>ISPR</ns0:Type> 
     </ns0:F40C> 
    </ns0:F40a> 
    <ns0:F77a> 
     <ns0:F77C> 
     <ns0:Narrative> 
      <ns0:Line>Line0</ns0:Line> 
      <ns0:Line>Line1</ns0:Line> 
     </ns0:Narrative> 
     </ns0:F77C> 
    </ns0:F77a> 
    </ns0:MT760> 
</ns0:Document> 

開発者が使用する可能性がありますそのような合成的に生成されたXML文書は、より具体的な、より具体的な目的に合致した、より意図的で手作業によるXMLの作成を開始する。

+0

そのオーケーに対して検証する際には、一致はありませんが、私はprogramiticallyこのXMLを生成する必要があります。 –

+0

提案があります –

+0

ありがとうございましたkjhughes私は指を.. –

0

このhttp://xsd2xml.com/を通して、あなたのXSDを実行し、ここで

<?xml version="1.0" encoding="utf-8"?> 
    <Document> 
     <MT760> 
     <F27a /> 
     <F20a /> 
     <F23a /> 
     <F30a /> 
     <F40a /> 
     <F77a /> 
     <F72a /> 
     </MT760> 
    </Document> 
+0

私はこれを働いたが、XSDファイル –

関連する問題