0

我为一家需要向监管机构报告交易、销售数据等的金融公司工作。目前我们正在为每个人这样做,因为我们无法让他们的 XML 模式模板工作。我正在尝试使用 xml 源窗格将其导入到 excel 中。

我们遇到的问题是,当我们导出文档时,出现了我们无法解决的非规范化数据错误。不幸的是,我自己和团队在映射 XML 方面没有太多经验,不知道如何正确解决它。我已经更改了各种代码,但没有成功,甚至联系了 FCA(他们说它没有任何问题或死链接……哈哈)。

有人可以就我们如何纠正这个问题提供一些见解或指导吗?

架构如下:

<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSpy v2005 U (http://www.xmlspy.com) by Clive Raven (LogicaCMG) -->
<!--
********************************************************************************
*
* Project Name : FSA Transaction Reporting System
* Reference    :
* Description  : Definition For FSA High-Street Firms Feed For Retail Investment Products
* Dependencies : http://www.fsa.gov.uk/XMLSchema/FSAFeedCommon-v1-1.xsd
*
* Revision History
* Version   Author              Date                Description
*  1.1          FSA                 07/04/2004      First published draft
*  1.2          FSA                 22/11/2004      Final draft
*  1.3          FSA                 19/02/2007      Added Self Invested Personal Pensions (SIPPs) product type in TypeOfPolicyType
*
* Copyright Financial Services Authority 2004
********************************************************************************
-->
<xs:schema xmlns="http://www.fsa.gov.uk/XMLSchema/FSAHSFFeedRI-v1-2" 
    xmlns:cmn="http://www.fsa.gov.uk/XMLSchema/FSAFeedCommon-v1-2" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="http://www.fsa.gov.uk/XMLSchema/FSAHSFFeedRI-v1-2" 
    elementFormDefault="qualified" 
    version="1.0"   
    id="FSAHSFFeedRI-v1-3">
    <xs:import namespace="http://www.fsa.gov.uk/XMLSchema/FSAFeedCommon-v1-2" 
        schemaLocation="https://gabriel.fca.org.uk/specifications/MER/DRG/PSD-CommonTypes/v1.2/FSAFeedCommon-v1-2.xsd"/>
    <!--Types used in FSAHSFFeedRI-->
    <xs:simpleType name="TypeOfPolicyType">
        <xs:annotation>
            <xs:documentation>Retail Investment Product Code.       </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:enumeration value="01">
                <xs:annotation>
                    <xs:documentation>Unit trust/OEIC</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="02">
                <xs:annotation>
                    <xs:documentation>Investment trust</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="03">
                <xs:annotation>
                    <xs:documentation>ISA</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="04">
                <xs:annotation>
                    <xs:documentation>Structured capital at risk product</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="05">
                <xs:annotation>
                    <xs:documentation>With profit bond</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="06">
                <xs:annotation>
                    <xs:documentation>Unit linked bond</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="07">
                <xs:annotation>
                    <xs:documentation>Distribution bond</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="08">
                <xs:annotation>
                    <xs:documentation>With profit endowment</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="09">
                <xs:annotation>
                    <xs:documentation>Endowment savings plan</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="10">
                <xs:annotation>
                    <xs:documentation>Mortgage endowment</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="11">
                <xs:annotation>
                    <xs:documentation>Guaranteed income/growth/investment bond</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="12">
                <xs:annotation>
                    <xs:documentation>Trustee investment bond</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="13">
                <xs:annotation>
                    <xs:documentation>Life annuity</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="14">
                <xs:annotation>
                    <xs:documentation>Pension annuity</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="15">
                <xs:annotation>
                    <xs:documentation>Long term care insurance</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="16">
                <xs:annotation>
                    <xs:documentation>Stakeholder pension</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="17">
                <xs:annotation>
                    <xs:documentation>Personal pension</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="18">
                <xs:annotation>
                    <xs:documentation>Group personal pension</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="19">
                <xs:annotation>
                    <xs:documentation>FSAVC</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="20">
                <xs:annotation>
                    <xs:documentation>Individual pension transfer</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="21">
                <xs:annotation>
                    <xs:documentation>Pension opt out</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="22">
                <xs:annotation>
                    <xs:documentation>Section 32 buy out</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="23">
                <xs:annotation>
                    <xs:documentation>Group section 32 buy out</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="24">
                <xs:annotation>
                    <xs:documentation>Income drawdown</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="25">
                <xs:annotation>
                    <xs:documentation>Executive pension</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="26">
                <xs:annotation>
                    <xs:documentation>SSAS</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="27">
                <xs:annotation>
                    <xs:documentation>Group money purchase</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="28">
                <xs:annotation>
                    <xs:documentation>AVC final salary</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="29">
                <xs:annotation>
                    <xs:documentation>AVC group money purchase</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="30">
                <xs:annotation>
                    <xs:documentation>Self Invested Personal Pensions (SIPPs)</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="99">
                <xs:annotation>
                    <xs:documentation>Other. Use this when product is not one of above.</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <!--Structures used in FSAHSFFeedRI -->
    <xs:complexType name="RetailInvestmentStructure">
        <xs:sequence>
            <xs:element name="PrincipalOrNetworkFSARef" type="cmn:FSARefType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>This field only applies if the sale has been made by an intermediary who has a principal or is part of a network. </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="TypePolicy" type="TypeOfPolicyType">
                <xs:annotation>
                    <xs:documentation>Type of policy.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="AdvisedSale" type="cmn:YNType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>This field is optional until July 2006, when it will become mandatory.  Y = Sale was Advised, N = Sale was non-Advised. For PSD reporting purposes non-Advised includes execution only and direct offer transactions.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="CustPostCode" type="cmn:PostCodeType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Full U.K postcode of customer.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="PremPaymentMethod" type="cmn:PremiumPaymentMethodType">
                <xs:annotation>
                    <xs:documentation>Method of premium/ contribution payment.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="TotalPremAmt" type="cmn:HSFStdSterlingAmountType">
                <xs:annotation>
                    <xs:documentation>Total premium/contribution amount. Annualised amount rounded to nearest pound.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="CustDOB" type="xs:date" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Date of birth of customer. Applies to first named customer at time of sale i.e. age obtained at proposal stage. Must represent an age up to and including 115.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="DateInForce" type="xs:date"/>
        </xs:sequence>
    </xs:complexType>
    <!--FSAHSFFeedRI -->
    <xs:element name="FSAHSFFeedRI">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cmn:FSAFeedHeader"/>
                <xs:element name="FSAHSFFeedRIMsg" minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:documentation>Defines the inidividual transactions</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element ref="cmn:CoreItems"/>
                            <xs:element name="RetailInvestment" type="RetailInvestmentStructure">
                                <xs:annotation>
                                    <xs:documentation>Defines the elements that are specific to a Retail Investment transaction.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

导入架构时,由于架构中引用了死链接,导入公共提要时出错:

SchemaLocation="https://gabriel.fca.org.uk/specifications/MER/DRG/PSD-CommonTypes/v1.2/FSAFeedCommon-v1-2.xsd

这可以从 FCA 资源部分单独下载,并且可以编辑架构以指向本地文件。见下文:

<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSpy v2005 U (http://www.xmlspy.com) by Clive Raven (LogicaCMG) -->
<!--
********************************************************************************
*
* Project Name : FSA Transaction Reporting System
* Reference    :
* Description  : Common Definitions For FSA Feeds
* Dependencies :
*
* Revision History
* Version   Author          Date                Description
*  1.1          FSA             07/04/2004      Published with early draft of SBD Schema's
*  1.2          FSA             22/11/2004      Published with final draft of all TRS Schema's
*
* Copyright Financial Services Authority 2004
********************************************************************************
-->
<xs:schema xmlns="http://www.fsa.gov.uk/XMLSchema/FSAFeedCommon-v1-2" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="http://www.fsa.gov.uk/XMLSchema/FSAFeedCommon-v1-2" 
    elementFormDefault="qualified" 
    version="1.2" 
    id="FSAFeedCommon-v1-2">
    <!--Common Types -->
    <xs:simpleType name="NonEmptyString">
        <xs:annotation>
            <xs:documentation>Defines a string type that may not be the empty string. Values of this type are also whitespace normalized meaning all-whitespace strings are also invalid.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="FSARefType">
        <xs:annotation>
            <xs:documentation>FSA Reference Number. Either a 6 or 7 digit number.  Leading zeroes are not expected.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="[1-9]{1}[0-9]{5,6}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="PostCodeType">
        <xs:annotation>
            <xs:documentation>Full or abbreviated UK postcode.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="8"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="YNType">
        <xs:annotation>
            <xs:documentation>Y or N</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:enumeration value="Y"/>
            <xs:enumeration value="N"/>
        </xs:restriction>
    </xs:simpleType>
    <!--Common SBD Types -->
    <xs:simpleType name="HSFStdSterlingAmountType">
        <xs:annotation>
            <xs:documentation>Integer from 1 to 999999999. Representing sterling-equivalent amount.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:positiveInteger">
            <xs:totalDigits value="9"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="PremiumPaymentMethodType">
        <xs:annotation>
            <xs:documentation>Method of Premium/Contribution payment. Single or Regular.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:enumeration value="S">
                <xs:annotation>
                    <xs:documentation>Single payment.</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="R">
                <xs:annotation>
                    <xs:documentation>Regular payment.</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <!--Common Structures -->
    <xs:element name="CoreItems">
        <xs:annotation>
            <xs:documentation>Defines the elements that are common to all transactions.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="FirmFSARef" type="FSARefType">
                    <xs:annotation>
                        <xs:documentation>The FSA code of the reporting firm for this transaction.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="TransRef">
                    <xs:annotation>
                        <xs:documentation>The unique reference, internal to the reporting firm, that will enable the firm to provide the FSA with more information concerning the trade if required. This reference must be unique within each report file, with the exception that a reference can occur twice if one occurrence is a cancellation. </xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                        <xs:restriction base="NonEmptyString">
                            <xs:maxLength value="25"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="Cancellation" type="xs:boolean" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>Indicates if the transaction is a cancellation. If ommitted this is logically the same as providing a value of 'false'.</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="FSAFeedHeader">
        <xs:annotation>
            <xs:documentation>Defines the report header, common to all reports.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="FeedTargetSchemaVersion" type="xs:string">
                    <xs:annotation>
                        <xs:documentation>Identifies the version of the business specific schema to which this report conforms.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="Submitter">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="SubmittingFirm" type="FSARefType">
                                <xs:annotation>
                                    <xs:documentation>The FSA code of the firm submitting the report.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="SubmittingDept" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>The identifier of the department within the submitting firm who created this report - optional.</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="NonEmptyString">
                                        <xs:maxLength value="20"/>
                                        <xs:pattern value="[a-zA-Z0-9]+"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="ReportDetails">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="ReportCreationDate" type="xs:date">
                                <xs:annotation>
                                    <xs:documentation>Report creation date.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="ReportIdentifier">
                                <xs:annotation>
                                    <xs:documentation>Unique identifier for the report (wthin the context of the submitter, submitting firm, submitting department and report creation date).</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                    <xs:restriction base="NonEmptyString">
                                        <xs:maxLength value="25"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

资源:
https ://regdata.fca.org.uk/specifications/DRG/PSD002/v1.5/FSAHSFFeedRI-v1-3.xsd - 完整架构
https://regdata.fca.org.uk/specifications/DRG/ PSD-CommonTypes/v1.2/FSAFeedCommon-v1-2.xsd - 使用死链接引用的架构
https://regdata.fca.org.uk/#/layout/resources - 一般资源

4

1 回答 1

0

我不确定你的问题到底是什么。你指出了2个问题:

  1. “非规范化数据错误”:你是什么意思?这与架构有什么关系?
  2. 主架构文件中的断开链接。您通过编辑schemaLocation主模式中的 自己解决了这个问题。如果您需要一种无需编辑主模式文件即可自动更正位置的方法,您可以使用XML Catalog。是你要找的吗?

“导入”模式是什么意思?您是在自己的架构中导入它吗?

目录如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">      
    <uri name="http://www.fsa.gov.uk/XMLSchema/FSAFeedCommon-v1-2"
  uri="path/to/local/copy/of/FSAFeedCommon-v1-2.xsd"/> 
</catalog>

然后,您需要配置解析器(验证工具)以使用该目录。

于 2022-02-11T13:20:02.223 回答