‎2010 Nov 09 12:24 PM
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>
‎2010 Nov 09 12:37 PM
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
‎2010 Nov 10 3:40 AM
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
‎2010 Nov 10 10:14 AM
<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
‎2010 Nov 12 5:19 AM