Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Removing header from a Document variable in Talend job

I have an XML stored in a Document type variable in Talend job.

<?xml version="1.0" encoding="UTF-8"?>
<ORDER><HEAD><DOC_STATUS>...</DOC_STATUS></HEAD></ORDER>

 I convert it with the tConvertType to String but I have header that I dont need left:
<?xml version="1.0" encoding="UTF-8"?>

What is the best way to remove this above in Talend? 

Labels (3)
2 Replies
TRF
Champion II
Champion II

Try yourString.replaceAll("^<\?xml.*\?>", "")
idembel2
Creator
Creator

Hi TRF,
I try your suggestion, but i got a bug.
Bellow, code works for me:

yourString.replaceAll("\\<\\?xml(.+?)\\?\\>", "")

Ibrahim