DataMapper - JSON -> XML - Add a colon in XML tag

Highlighted
One Star

DataMapper - JSON -> XML - Add a colon in XML tag

Hello everyone,
Today i want to generate an XML file from a JSON.
I already generate XML files but I here I want to generate a particular one, this is an XML in google format.
Like this:
<entry>
<g:id>114778689</g:id>
<g:title>My PRODUCT</g:title>
</entry>

My problem is the colon because on STUDIO it is prohibit to add a colon( : ) in an XML tag. 
Has anyone had a solution to work this in mapping?
Actual, the only solution is to make a replacement after file generation (not good).

Thank's for your help !
Moderator

Re: DataMapper - JSON -> XML - Add a colon in XML tag

Hello,

Could you please post your trouble screenshot on forum? What is talend build version are you using?

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.
Nine Stars

Re: DataMapper - JSON -> XML - Add a colon in XML tag

Hi, 

 

You have to declare a namespace.

 

You can create a XML structure importing this file:

<entry xmlns:g="http://www.w3.org/TR/html4/">
<g:id>114778689</g:id>
<g:title>My PRODUCT</g:title>
</entry>

 

Then you get:

Capture.PNG

Regards.

 

Eric

One Star

Re: DataMapper - JSON -> XML - Add a colon in XML tag


@eric44 wrote:

Hi, 

 

You have to declare a namespace.

 

You can create a XML structure importing this file:

<entry xmlns:g="https://theessayservice.org/buy-term-paper/">
<g:id>114778689</g:id>
<g:title>My PRODUCT</g:title>
</entry>

 

Then you get:

Capture.PNG

 


Oh, I see now. Without importing that file it won't working... Thanks a lot!

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch