Siebel Open UI, Tools, Scripting and EAI (MOSC)

MOSC Banner

How to remove XML Container Element if its fields are empty ?

edited Jan 27, 2020 8:54AM in Siebel Open UI, Tools, Scripting and EAI (MOSC) 6 commentsAnswered

Hi Team,

I have a requirement where in my xml is as below

<SiebelMessage>

<IO>

<IC1>

  <Field1> 1</Field1>

  <Field2> 2</Field3>

  <Field3> 3</Field3>

</IC1>

<IC2>

  <Field1> 1</Field1>

  <Field2> 2</Field3>

  <Field3> 3</Field3>

</IC2>

<IC3>  //---- Since the fields are empty

  </IC3>

</IO>

<SiebelMessage>

I would like to only see as below

<SiebelMessage>

<IO>

<IC1>

  <Field1> 1</Field1>

  <Field2> 2</Field3>

  <Field3> 3</Field3>

</IC1>

<IC2>

  <Field1> 1</Field1>

  <Field2> 2</Field3>

  <Field3> 3</Field3>

</IC2>

</IO>

<SiebelMessage>

IC 3 must be removed from the message since its fields are null/empty , I dont want to write custom code because its not limited to IC3 i might have very well 20 ICs and randomly only couple of IC will have data, so need some configurable solution ? Any ideas please

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center