[resolved] "Replace all rows by import from xml file" xml format?

Four Stars

[resolved] "Replace all rows by import from xml file" xml format?

I'd like to import XML instead of typing my schema definitions into the UI. There is a handy button ""Replace all rows by import from xml file" -- but what is the format of that XML file supposed to be? I've looked all over the place, cannot find it anywhere.
Thanks

Accepted Solutions
Four Stars

Re: [resolved] "Replace all rows by import from xml file" xml format?

Lots of trial and error and google-ing around (it's good to know that talendforge shows up in Google search results :-)
I came up with this (sorry, I'm only using String datatype so far):

<?xml version="1.0" encoding="UTF-8"?>
<schema>
<column
comment=""
default=""
key="false"
label="Brand"
length="99"
nullable="true"
originalDbColumnName="Brand"
pattern=""
precision="-1"
talendType="id_String"/>
<column
comment=""
default=""
key="false"
label="Manufacturer"
length="99"
nullable="true"
originalDbColumnName="Manufacturer"
pattern=""
precision="-1"
talendType="id_String"/>
<column
comment=""
default=""
key="false"
label="ProductModelName"
length="99"
nullable="true"
originalDbColumnName="ProductModelName"
pattern=""
precision="-1"
talendType="id_String"/>
</schema>

All Replies
Four Stars

Re: [resolved] "Replace all rows by import from xml file" xml format?

Lots of trial and error and google-ing around (it's good to know that talendforge shows up in Google search results :-)
I came up with this (sorry, I'm only using String datatype so far):

<?xml version="1.0" encoding="UTF-8"?>
<schema>
<column
comment=""
default=""
key="false"
label="Brand"
length="99"
nullable="true"
originalDbColumnName="Brand"
pattern=""
precision="-1"
talendType="id_String"/>
<column
comment=""
default=""
key="false"
label="Manufacturer"
length="99"
nullable="true"
originalDbColumnName="Manufacturer"
pattern=""
precision="-1"
talendType="id_String"/>
<column
comment=""
default=""
key="false"
label="ProductModelName"
length="99"
nullable="true"
originalDbColumnName="ProductModelName"
pattern=""
precision="-1"
talendType="id_String"/>
</schema>

Re: [resolved] "Replace all rows by import from xml file" xml format?

 <?xml version="1.0" encoding="UTF-8"?>
<schema>
<column comment="" default="" key="false" label="newColumn"
length="255" nullable="true" originalDbColumnName="newColumn"
pattern="" precision="-1" talendType="id_String" type=""/>
<column comment="" default="" key="false" label="newColumn1"
length="255" nullable="true" originalDbColumnName="newColumn1"
pattern="" precision="-1" talendType="id_Boolean" type=""/>
<column comment="" default="" key="false" label="newColumn2"
length="255" nullable="true" originalDbColumnName="newColumn2"
pattern="" precision="-1" talendType="id_Integer" type=""/>
<column comment="" default="" key="false" label="newColumn3"
length="255" nullable="true" originalDbColumnName="newColumn3"
pattern=""dd-MM-yyyy"" precision="-1"
talendType="id_Date" type=""/>
<column comment="" default="" key="false" label="newColumn4"
length="255" nullable="true" originalDbColumnName="newColumn4"
pattern="" precision="-1" talendType="id_Long" type=""/>
<column comment="" default="" key="false" label="newColumn5"
length="255" nullable="true" originalDbColumnName="newColumn5"
pattern="" precision="-1" talendType="id_BigDecimal" type=""/>
<column comment="" default="" key="false" label="newColumn6"
length="255" nullable="true" originalDbColumnName="newColumn6"
pattern="" precision="-1" talendType="id_Character" type=""/>
</schema>
Four Stars

Re: [resolved] "Replace all rows by import from xml file" xml format?

This is great! Covers them all! Thanks for posting.

Re: [resolved] "Replace all rows by import from xml file" xml format?

No problem if you want for another type that I did not add above just ask Smiley Happy
One Star

Re: [resolved] "Replace all rows by import from xml file" xml format?

I am trying to import xml file in edit schema.It seems that It is not working at all. Everytime I am defining my schema manually.Can anybody help me How can make it ?
Moderator

Re: [resolved] "Replace all rows by import from xml file" xml format?

Hi harkiratsingh,
What's your current job design? Are you looking for file xml metadata?
Can you please explain your request with some example data? so we can give you more accurate answers.

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.
One Star

Re: [resolved] "Replace all rows by import from xml file" xml format?

Hi Brandon,

 

Thanks for the XML format. It was really helpful Smiley Happy

 

However, in a tMap component for the output section,there is an addition column for adding expression where we input the parseString for each column based on the datatype.

 

Can we also add this "Expression" field in the XML?

 

Regards,

Prakhar