Skip to Content
0

Appending multiple proxy calls into single XML file

Apr 23 at 11:39 AM

27

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Che Eky Apr 24 at 10:14 AM
0

"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?

Show 2 Share
10 |10000 characters needed characters left characters exceeded
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>

0
"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?

0