简体   繁体   English

在xml源中设置映射时出错

[英]Error while setting up the mapping in xml source

I am using a xml file to read which contains multiple namespaces. 我正在使用xml文件读取包含多个名称空间的文件。 And i have XSD file for that which i am using. 我有我正在使用的XSD文件。 But there was an error saying that 但是有一个错误说

"Error at Data Flow Task [XML Source [1]]: There was an error setting up the mapping. 
 The '{http://www.fpml.org/2005/FpML-4-2}:header' element is not declared.
 (Microsoft Visual Studio)"

But when i check the xsd file it contains the definition for that. 但是,当我检查xsd文件时,它包含该文件的定义。

My files are as follows. 我的文件如下。

 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns="http://link"  
            xmlns:ns1="http://link2" 
            xmlns:ns2="http://link"  
            xmlns:xs="http://www.w3.org/2001/XMLSchema"  
            targetNamespace="http://targetnamaspace">

   <xs:import namespace="http://link"  schemaLocation="XmlPositions1.xsd"/>
   <xs:import namespace="http://link2" schemaLocation="XmlPositions2.xsd"/>

and my xml file is as below 我的xml文件如下

 <?xml version="1.0" encoding="utf-8"?>
 <ns0:message xmlns:ns0="http://target" version="4-2"  
              xmlns:ns1="http://link2" 
              xmlns:ns2="http://link"  
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xsi:type="ns0:SoaMethodsResult">
      <ns1:header>
         <ns1:messageId messageIdScheme=""></ns1:messageId>
         <ns1:sentBy partyIdScheme="http://reference">SOPHIS</ns1:sentBy>
         <ns1:creationTimestamp>2014-03-21T22:20:40+01:00</ns1:creationTimestamp>

Please let m know if you have any question. 如有任何疑问,请告诉我。 Thanks for helping me out! 谢谢你的协助!

Where is the part of your schema documents where you import a schema document for namespace http://www.fpml.org/2005/FpML-4-2 ? 模式文件的哪一部分在哪里导入名称空间http://www.fpml.org/2005/FpML-4-2的模式文件?

If there is such a part, it's not working (but because you don't show it to us, no one here can tell you why it's not working). 如果有这样的部分,则它不起作用(但是由于您没有向我们展示,所以这里没有人可以告诉您为什么它不起作用)。

If there is no such part, your problem is that you're not importing that namespace. 如果没有这样的部分,那么您的问题是您没有导入该名称空间。

Judging by the namespace and the text SOPHIS in the sentby section I would guess this is Sophis Risque (or Value) fpml. 从名称空间和sendby部分中的文本SOPHIS来看,我猜这是Sophis Risque(或Value)fpml。 The Sophis supplied XML schema's are notoriously patchy and this could the reason for your rejection. Sophis提供的XML模式众所周知是不完整的,这可能是您拒绝的原因。 I seem to remember having to 'adjust' them slightly to get them to work correctly. 我似乎记得必须稍作“调整”以使其正常工作。 Good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM