cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove the header tag in the XML data ?

Former Member
0 Kudos

Hi All,

I am sending an XML data from SFTP to Proxy, in that I want to remove the header tag (first tag) from the xml, while loading the data. how to do that ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can aheive it by using doccuemt offset : ignored.

Sameer

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have converted the flat file to xml using the "Content Conversion Using MessageTransformBean". In that there is no "document offset" parameter. so pls tell me how to remove this part from the xml data.

<Emp_details>

<Emp_Id> Employee No </Emp_Id> // I want to remove this whole part.

<Emp_Name> Employee Name </Emp_Name>

</Emp_details>

<Emp_details>

<Emp_Id> 1234 </Emp_Id>

<Emp_Name> xxxx </Emp_Name>

</Emp_details>

<Emp_details>

<Emp_Id> 5678 </Emp_Id>

<Emp_Name> yyy </Emp_Name>

</Emp_details>

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi,

> I have converted the flat file to xml using the "Content Conversion Using MessageTransformBean". In that there is no "document offset" parameter. so pls tell me how to remove this part from the xml data.

I dont think there is an option when you use the MessageTransformBean. Will wait to see if somebody know it can be done.

But meanwhile, i suggest that you can always ignore that header when you do the transformation to the target by not mapping that.

Else another way would be to use a java mapping and remove that particular entry.

former_member181962
Active Contributor
0 Kudos

Hi,

Does your SOURCE TEXT file has this header information?

Then you can restrict that information in the Message Mapping by putting a condition

if you are mapping <Emp_Details> node to some target node, then put a condition like

<Emp_Details> -> Index ->      Equals -> Not ->If ->    YOur Target Node
               Constant "1"             <Emp_Details>

Regards,

ravi

Edited by: Ravi Kanth Talagana on May 14, 2009 1:21 PM

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi All,

>

> I am sending an XML data from SFTP to Proxy, in that I want to remove the header tag (first tag) from the xml, while loading the data. how to do that ?

The header is in the Source XML right?

So in that case dont try to remove the header tag etc. Read it completely and when you have to map it to the target, make sure you dont map it. that way it is as good as you ignored the header tag.

Spending time and effort to remove something in the source data structure is not advised unless for any specific reasons

Former Member
0 Kudos

Hi Sabharish,

Thanks for your comment. But my input file is text, i am converting that to xml, so in the output i am getting the header fields as the first tag in the xml like,

<Emp_details>

<Emp_Id> Employee No </Emp_Id>

<Emp_Name> Employee Name </Emp_Name>

</Emp_details>

<Emp_details>

<Emp_Id> 1234 </Emp_Id>

<Emp_Name> xxxx </Emp_Name>

</Emp_details>

<Emp_details>

<Emp_Id> 5678 </Emp_Id>

<Emp_Name> yyy </Emp_Name>

</Emp_details>

so I want only the data.... what should I do to remove the first tag... ?

Shabarish_Nair
Active Contributor
0 Kudos

use the option as below in the adapter

Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.

This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines.

More @ http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

Former Member
0 Kudos

Hi,

It is not about the thing that, whether your source is XML or flat file. If you dont want some thing in your source file , dont consider it and dont map it with your target structure. think that, your not getting the header in your source. What is the header here.

<Emp_details>

<Emp_Id> Employee No </Emp_Id>

<Emp_Name> Employee Name </Emp_Name>

</Emp_details>

<Emp_details>

<Emp_Id> 1234 </Emp_Id>

<Emp_Name> xxxx </Emp_Name>

</Emp_details>

<Emp_details>

<Emp_Id> 5678 </Emp_Id>

<Emp_Name> yyy </Emp_Name>

</Emp_details>

you have two fields under node Emp_details. What do u want to avoid here?

Regards,

Reyaz