# XML Top Level Error

**URL:** <https://forum.kirupa.com/t/xml-top-level-error/148562>\
**Category:** Uncategorized\
**Created:** [May 20, 2005, 10:50pm UTC](https://forum.kirupa.com/t/xml-top-level-error/148562 "2005-05-20T22:50:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghjr](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@ghjr](https://forum.kirupa.com/u/ghjr)\
**Post date:** [May 20, 2005, 10:50pm UTC](https://forum.kirupa.com/t/xml-top-level-error/148562/1 "2005-05-20T22:50:19Z")

</div>

Ok, I’m importing an XML file in to flash, editing it and then sending it back for PHP to overwrite the old XML file.

Trouble is, when I go to send it the following error message pops up:

**Invalid at the top level of the document.**

The XML file then gets overwritten with a number like **8695** (maybe an error number) instead of the content sent from flash. There are two other topics (see one here: [http://www.kirupa.com/forum/showthread.php?t=88849&highlight=invalid+top+level](http://www.kirupa.com/forum/showthread.php?t=88849&highlight=invalid+top+level)) about this here at Kirupa, but they both suggest changing the xml version declaration, which I did but that didn’t help much (I even tried taking out the version declaration).

Here is a example of parte of my XML file for reference:

```auto

<?xml version="1.0" ?> 
<xml>

<argentina>
  <estatico>
    <categoria imagem="images/google.jpg" service="Google Sites" users="2.648" reach="66.3" />
    <categoria imagem="images/teRespondo.jpg" service="MSN Search" users="1.465" reach="36.7" />
    <categoria imagem="images/yahoo.jpg" service="Yahoo! Search" users="445" reach="11.1" />
    <categoria imagem="" service="Ask Jeeves" users="427" reach="10.7" />
    <categoria imagem="images/overture.jpg" service="AltaVista Network" users="294" reach="7.4" />
    <categoria imagem="" service="MSN Toolbar" users="227" reach="5.7" />
    <categoria imagem="" service="CNET Search.com" users="178" reach="4.5" />
    <categoria imagem="" service="PERGAMINOVIRTUAL.COM.AR" users="133" reach="3.3" />
    <categoria imagem="" service="Microsoft Search" users="105" reach="2.6" />
    <categoria imagem="" service="LOP.COM" users="102" reach="2.5" />
    <categoria imagem="" service="Hispavista Search" users="102" reach="2.5" />
    <categoria imagem="images/teRespondoGoogle.jpg" service="Lycos Network Search" users="89" reach="2.2" />
    <categoria imagem="" service="TURBONIC.COM" users="82" reach="2.1" />
    <categoria imagem="images/teRespondo.jpg" service="T1MSN Search" users="71" reach="1.8" />
    <categoria imagem="" service="Intermix Search" users="69" reach="1.7" />
    <categoria imagem="images/yahoo.jpg" service="Yahoo! En Espanol Web Search" users="63" reach="1.6" />
    <categoria imagem="" service="EXACTRESULT.COM" users="63" reach="1.6" />
    <categoria imagem="" service="INSTAFINDER.COM" users="54" reach="1.4" />
    <categoria imagem="" service="UOLSinectis Buscador" users="40" reach="1.0" />
    <categoria imagem="" service="SEARCHFOO.COM" users="38" reach="0.9" />
    <categoria imagem="" service="ALLTHEWEB.COM" users="37" reach="0.9" />
    <categoria imagem="" service="MYSEARCHNOW.COM" users="35" reach="0.9" />
    <categoria imagem="images/teRespondo.jpg" service="GIGABUSCA.COM.BR" users="28" reach="0.7" />
    <categoria imagem="images/yahoo.jpg" service="Yahoo! Mexico Search" users="28" reach="0.7" />
  </estatico>
</argentina>

</xml>

```
