Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error when opening xml file .....

Former Member
0 Likes
1,063

Hi all,

I am using Simple transforamtion and trying to download the file to presentation server.

The file is downloaded and when i open it i get this message :

"XML document must have a top level element. Error processing resource "

Please let me know whats wrong...

<?sap.transform simple?>

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

<tt:root name="root1"/>

<tt:root name="root2"/>

<tt:template>

<tt:loop name="r1" ref=".root1">

<ORDERNR>

<tt:value ref="$r1.ordernr"/>

<CUSTOMER>

<tt:s-cond check="initial($r1.customer)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r1.customer"/>

</CUSTOMER>

<DESTINATION>

<tt:value ref="$r1.destination"/>

</DESTINATION>

<SUPPLIER>

<tt:s-cond check="initial($r1.supplier)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r1.supplier"/>

</SUPPLIER>

<BRUKARE>

<tt:s-cond check="initial($r1.brukare)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r1.brukare"/>

</BRUKARE>

<SOURCE>

<tt:s-cond check="initial($r1.source)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r1.source"/>

</SOURCE>

<tt:loop name="r2" ref=".root2">

<HU>

<ID>

<tt:s-cond check="initial($r2.id)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.id"/>

</ID>

<TYPE>

<tt:s-cond check="initial($r2.type)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.type"/>

</TYPE>

<SORTIMENT>

<tt:s-cond check="initial($r2.sortiment)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.sortiment"/>

</SORTIMENT>

<WEIGHT>

<tt:s-cond check="initial($r2.weight)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.weight"/>

</WEIGHT>

<VOLUME>

<tt:s-cond check="initial($r2.volume)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.volume"/>

</VOLUME>

<FLOORSPACE>

<tt:s-cond check="initial($r2.floorspace)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.floorspace"/>

</FLOORSPACE>

<STATUS>

<tt:s-cond check="initial($r2.status)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.status"/>

</STATUS>

<WORKUNITID>

<tt:s-cond check="initial($r2.workunitid)">

<tt:text> </tt:text>

</tt:s-cond>

<tt:value ref="$r2.workunitid"/>

</WORKUNITID>

</HU>

</tt:loop>

</ORDERNR>

</tt:loop>

</tt:template>

</tt:transform>

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
681

Basically what it says: "top level element missing".

Try inserting <node> after <tt:template> and </node> before </tt:template>, or name it as desired.

Thomas

Read only

0 Likes
681

Hi,

i did this..

<tt:template>

<ORDERNR>

<tt:loop name="r1" ref=".root1">

-


but still i am getting the same error...

XML document must have a top level element. Error processing resource 'file:///C:/20101110043812_5051_175.xml'.

can anyone help me in this??

Edited by: Poonam Naik on Nov 10, 2010 7:45 AM

Read only

0 Likes
681

<ORDERNR> is already an existing node, maybe this is a problem, use a different name, e.g. <ORDERS>, make sure you close it in the end with </ORDERS>.

Thomas

Read only

0 Likes
681

The problem was in conversion of string....

thanks...