cancel
Showing results for 
Search instead for 
Did you mean: 

Appending multiple proxy calls into single XML file

0 Kudos

Hello Experts,

I'm trying to append multiple proxy calls into a single XML file. A simple APPEND function in Communication channel repeats the XML header Tags (<?xml version="1.0" encoding="UTF-8"?>) and the XML is not well formed.

Removing the XML header using XSLT mapping and then appending the rest of the data again causes not well formed XML even when we check by manually adding the XML header(I can later add XML header after appending the file using XSLT).

Is there a known easier approach for handling multiple proxy calls into a single XML file in receiver? I have seen blogs which shows the possibility with flat file. The challenge is that the receiver file is in XML format.

Your inputs are appreciated.

PI version used: 7.11

Accepted Solutions (0)

Answers (1)

Answers (1)

che_eky
Active Contributor
0 Kudos

"Removing the XML header using XSLT mapping and then appending the rest of the data again causes not well formed XML"

Are you saying the XML is well formed but you get an error saying it is not? Or is your XSLT producing not well formed XML?

0 Kudos
After removing the XML header using XSLT mapping and viewing the appended data in XML viewer, I get a error stating "Extra content at the end of the document". My XML structure after appending and removing the header is something similar to the below structure.

<RootElement xmlns="http://www.sample.com/Sampledata">
	<ChildElement>
		<data>1234</data>
		<name>Person</name>
	</ChildElement>
</RootElement>
<RootElement xmlns="http://www.sample.com/Sampledata">
	<ChildElement>
		<data>1234</data>
		<name>Person</name>
	</ChildElement>
</RootElement>
<RootElement xmlns="http://www.sample.com/Sampledata">
	<ChildElement>
		<data>1234</data>
		<name>Person</name>
	</ChildElement>
</RootElement>

che_eky
Active Contributor
0 Kudos
"Extra content at the end of the document"

Sounds like some erroneous characters at the end of the file. Try viewing the file in Microsoft Word with all formatting displayed:

File -> Options -> Display -> Show all formatting marks

It may give you a clue to what the extra content it is complaining about. If the XML "looks" valid why not ask your vendor if they can work with it?