0

I am using a xml file to read which contains multiple namespaces. And i have XSD file for that which i am using. 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.

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 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!

Peter Rosemann
  • 505
  • 8
  • 20
  • Please add the relevant parts of your XML Schema and include the full headers of your instance and XSDs. The error says the namespace-qualified header element was not declared. It's not possible to help without knowing if that namespace is link, link2, target, or whatever bogus namespaces you used. The namespace is relevant. Edit your question and add this information. – helderdarocha Mar 28 '14 at 20:05

2 Answers2

0

Where is the part of your schema documents where you import a schema document for namespace 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.

C. M. Sperberg-McQueen
  • 24,596
  • 5
  • 38
  • 65
  • Hi thanks for your reply . yeah the XSD file was not well formated. Now there is no error. But still i can't import the data i mean rows are emty where as xml source is showing all the tables present in the xml file. but the parsed data null. program executes and no rows are produced – Nitesh Kumar SHARMA Mar 31 '14 at 08:55
0

Judging by the namespace and the text SOPHIS in the sentby section I would guess this is Sophis Risque (or Value) fpml. The Sophis supplied XML schema's are notoriously patchy and this could the reason for your rejection. I seem to remember having to 'adjust' them slightly to get them to work correctly. Good luck

Paul
  • 1