Four Stars

tFileOutputXML - namespace issue

Hi,

I am creating a Talend job where I extract details from database and create an output XML file. The components I use are -

tMSSQLInput -> tMap -> tFileOutputXML.

 

There is an XSD that I am using in Metadata(FileXML) to import the XML schema.

I see that in the SchemaImport editor the namespace is correctly getting created and I am mapping the details correctly. Attached is the screenshot (with ftc and sfa).

 

However, when I run the job and see the XML output. I don't see the namespace details nor the namespace prefix anywhere.

This is what I get -

<?xml version="1.0" encoding="ISO-8859-15"?>
<root>
<row>
<version>1</version>
<SendingCompanyIN>1</SendingCompanyIN>
<TransmittingCountry>1</TransmittingCountry>
<ReceivingCountry>1</ReceivingCountry>
<MessageType>1</MessageType>
<MessageRefId>1</MessageRefId>
<ReportingPeriod></ReportingPeriod>
....
</row>

But what I want to see in the output XML format  is -

 

<?xml version="1.0" encoding="utf-8"?>
<ftc:XXXXX_OECD xmlns:ftc="urnSmiley Surprisedecd:ties:XXXXX:v2" xmlns:sfa="urnSmiley Surprisedecd:ties:XXXXXXXX:v2" version="2.0">
  <ftc:MessageSpec>
    <sfaSmiley FrustratedendingCompanyIN>1</sfaSmiley FrustratedendingCompanyIN>
    <sfa:TransmittingCountry>1</sfa:TransmittingCountry>
    <sfa:ReceivingCountry>1</sfa:ReceivingCountry>
    <sfa:MessageType>1</sfa:MessageType>
    <sfa:MessageRefId>1</sfa:MessageRefId>
    <sfa:ReportingPeriod>xxxx</sfa:ReportingPeriod>
    <sfa:Timestamp>xxxxx</sfa:Timestamp>
  </ftc:MessageSpec>
  <ftc:XXXXX>
    <ftc:ReportingFI>
      <sfa:ResCountryCode>1</sfa:ResCountryCode>
      <sfa:xxx>1</sfa:xxx>
      <sfa:Name>1</sfa:Name>
      <sfa:Address>
        <sfa:CountryCode>1</sfa:CountryCode>
        <sfa:AddressFree>1</sfa:AddressFree>
      </sfa:Address>
      <ftc:FilerCategory>1</ftc:FilerCategory>
      <ftcSmiley Very HappyocSpec>
        <ftcSmiley Very HappyocTypeIndic>1</ftcSmiley Very HappyocTypeIndic>
        <ftcSmiley Very HappyocRefId>1</ftcSmiley Very HappyocRefId>
      </ftcSmiley Very HappyocSpec>
    </ftc:ReportingFI>
 ......

Thanks for your time!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: tFileOutputXML - namespace issue

Hi,

Thanks for posting that you have resolved your issue by yourself. Please mark this topic as resolved.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
2 REPLIES
Four Stars

Re: tFileOutputXML - namespace issue

I found the issue. I had to use tAdvancedFileOutputXML instead of tFileOutputXML. Thanks!
Moderator

Re: tFileOutputXML - namespace issue

Hi,

Thanks for posting that you have resolved your issue by yourself. Please mark this topic as resolved.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.