cancel
Showing results for 
Search instead for 
Did you mean: 

Only one top level element is allowed in an XML document. Error message

Former Member
0 Kudos

Hi all, Am receiving above message when trying to view XML data generation. Have found little to no documentation on this particular message and thus far unable to research/guess my way to resolition. Any and all help will greatly appreciated. Thanks in advance for the help, harold

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I had been using MC Internet Explorer until this . Have compared this one to functioning XML viewable with MS Internet explorer. Below is code I am using trying to resolve this problem.

<?xml version="1.0"?>

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="ecrtas"/>

<tt:template>

<tt:loop ref="ecrtas">

<ImportInstructions>

<ProjectSponsorInstruction>

<Instruction mode="Add">

<SponsorName tt:value-ref="SPONME"/>

<SponsorNumber>

<IdValue name="Sponsor Number"><tt:value ref="SPONSOR"/></IdValue>

</SponsorNumber>

<SponsorType tt:value-ref="SPONTYP"/>

</Instruction>

</ProjectSponsorInstruction>

</ImportInstructions>

</tt:loop>

</tt:template>

</tt:transform>

Thank you again

Former Member
0 Kudos

Hi Harold!

So what is your problem? I can watch this document with Altova XML Spy as well as with MSIE 6.0.

Again in which tool do you have problems?

Regards,

Volker

Former Member
0 Kudos

Hi,

Could you tell as exactly what error your getting and what data is sent.

Regards

Archanaa

Former Member
0 Kudos

Hi Harold!

Please give us some more details. in which tool do you try how to view which XML data?

Is it an external definition?

If so give us an idea about the content.

Regards,

Volker

Former Member
0 Kudos

Hello Harold,

The XML you have is not well defined. it should only have one root element eg.:

This document is correct and has only one root element, which is 'a':

<?xml version="1.0" encoding="UTF-8"?>
<a>
	<b>
		<somedata>aa</somedata>
	</b>
	<b>
		<somedata>bb</somedata>
	</b>
	<b>
		<somedata>cc</somedata>
	</b>
	<b>
		<somedata>dd</somedata>
	</b>
</a>

This is an incorrect xml with more than one root element:

<?xml version="1.0" encoding="UTF-8"?>
<a>
	<b>
		<somedata>aa</somedata>
	</b>
	<b>
		<somedata>bb</somedata>
	</b>
</a>
<a>
	<b>
		<somedata>aa</somedata>
	</b>
	<b>
		<somedata>bb</somedata>
	</b>
</a>