View unanswered posts | View active topics



Reply to topic  [ 4 posts ] 
Error #1088: The markup in the document following the root.. 
Author Message
Member

Joined: Tue May 20, 2008 12:33 pm
Posts: 2
Reply with quote
Hello,

I'm getting an error when loading xml into my flash document.
I've checked the XML-document with 2 oline check sites, the one from w3c and xml.com. They both tell me the XML is well formed.

FD gives the following output error:

[Fault] exception, information=TypeError: Error #1088: The markup in the document following the root element must be well-formed.
Fault, xmlLoaded() at Application.as:244

I really don't know what is means. I tried a lot and I don't know where to look.
When I create a var with the XML in my application it works... but i want it to be dynamic so i need to load the xml.
The code to load the XML is from the book Essential Actionscript 3.0 from Colin Moock.

I hope you can help me out.

Thanks in advance,
Jeron


Here's the code I use in FD:
Code:
//XML Laden
      private function loadMyXML():void {
         
         flash.events.HTTPStatusEvent.HTTP_STATUS;
         var XML_URL:String = "http://buisman.sitezone.nl/xml.asp";
         
         var myXMLURL:URLRequest = new URLRequest(XML_URL);
         myLoader = new URLLoader();
         
         myLoader.addEventListener(Event.COMPLETE, xmlLoaded);
         
         myLoader.load(myXMLURL);
      }
      
      private function xmlLoaded(event:Event):void {
         myXML = new XML(myLoader.data);
         //trace(myXML.toXMLString());
         //creatArrayXML();
      }



Mon Jun 02, 2008 12:42 pm
Profile
Member

Joined: Sat Mar 27, 2010 10:41 pm
Posts: 1
Reply with quote
Excuse the reply to a post 2 years old but it might be some use to people encountering this frustrating problem.

For well-formed XML returning
TypeError: Error #1088: The markup in the document following the root element must be well-formed,
often the problem is the BOM.

Actionscript XML does not strip the BOM (Byte Order Mark) from incoming text. The BOM is an invisible character (#65279) created at the beginning of a ASP or php "echo" string, as well as some text editors, to indicate the byte-ordering of multibyte text.

You can confirm if your string has this BOM character like this:
trace( sXMLString.charCodeAt( 0 ) ); //outputs 65279

The quick solution is
sXMLString= sXMLString.replace( String.fromCharCode(65279), "" ) ;
myXML = new XML(sXMLString);


Sat Mar 27, 2010 10:53 pm
Profile
Member

Joined: Tue May 20, 2008 12:33 pm
Posts: 2
Reply with quote
Thanks for your reply, I've been waiting for it for two years now, finally I can move on :)
To be serious it's sometimes very frustrating to get errors like that. I created everything in Flash to get rid of the problem.
Luckily it's solved now and everybody can use it in future projects.


Sun Mar 28, 2010 12:14 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Sounds like a corrupted BOM issue to me. I had only this issue once.


Sun Mar 28, 2010 3:24 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.