cancel
Showing results for 
Search instead for 
Did you mean: 

Create empty tag

former_member229310
Active Participant
0 Kudos

Hello Gurus,

I need to generate below mapping for a field in mapping.

<filed></field>

If i pass a constant blank value then after mapping the output shown is  </filed>  which is excluded by target system.

Hence target system are requesting to send start tag and end tag without any value.

Thanks in advance.

Accepted Solutions (0)

Answers (8)

Answers (8)

0 Kudos

Hi,

<filed></field> and </filed> are both the same. if u want same <filed></filed> you need to write Udf to achieve that on.

Thanks

srikanth

Former Member
0 Kudos

<filed></field> and </filed> are both the same. Your target techee would know it 🙂

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

as i suguest in my first post. mapthe field with a value (space, character,etc)

<field></field> and </field>is the same for fields with null values

Regards

baskar_gopalakrishnan2
Active Contributor
0 Kudos

This is my few cents ...

If the XML tag element has value the syntax  is

<field>some value </field>

If the element has no value then you should generate the tag element as

<field/>

so if you send the tag element syntax has <field/>  all the xml parsers should accept.  This is syntax rule.  Even if you do mapping or any sort of manipulations it will pass only  as <field/>

But if you send as </field>  then it is wrong... You are missing the start tag.. and see where you miss it.

Hope that helps.

manigram
Active Participant
0 Kudos

Hi,

Try mapWithDefault node function

Regards,

Mani

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Hari,

Can you right-click on the payload and choose view source? If it is displaying as </filed> then it is the content of your XML. What you can do to transform it to <filed></filed> is to use Java/XSLT mapping. Even if in the view source the field is <filed></filed>, it could still display as </filed> in some browsers (e.g moni).

Hope this helps,
Mark

Muniyappan
Active Contributor
0 Kudos

Hi Hari,

i believe both are same.

<filed></field>

</filed>

Did you check below link?

http://stackoverflow.com/questions/7238254/xml-what-is-this-null-or-empty-element

else you can use mapWithDefault to pass some constant value to target field.

Regards,

Muniyappan.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi

you have to know that <filed></field> is the same as </field> so if you need to generate the node to be sent to tha backend maybe you can think about send an space in the field for example.

Regards

Rodrigo