XML Parsing Error

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

XML Parsing Error

Post by jwbuzz » Wed May 12, 2010 9:37 pm

I'm using Revolution to communicate with a web service. I'm receiving an XML error (see attached screenshot). It's a pretty simple xml string, so it's not evident to me what the problem is. Any suggestions?
Screen shot 2010-05-12 at 3.32.35 PM.png
Screen shot 2010-05-12 at 3.32.35 PM.png (17.36 KiB) Viewed 2808 times
The XML is as follows:

<?xml version="1.0" encoding="utf-8"?>
<data/>


Here is the code snippet that processes it:

Code: Select all

 put revCreateXMLTree(theWebPageContent,true,true,false) into tTree
      if tTree is not an integer then
        answer error "Failed to process response with error " & tTree
      else
        put revXMLNodeContents(tTree,"data/message/messagetype") into tContents
      answer tContents
      end if

Curry
Posts: 111
Joined: Mon Oct 15, 2007 11:34 pm
Contact:

Re: XML Parsing Error

Post by Curry » Wed May 12, 2010 10:17 pm

First try validating your XML with another program (Internet Explorer, W3 validator, or etc.) and make sure that is well-formed.

Edit: Oh, I see your XML is listed.
Best wishes,

Curry Kenworthy

LiveCode Development, Training & Consulting
http://livecodeconsulting.com/

WordLib: Conquer MS Word & OpenOffice
SpreadLib: "Excel-lent" spreadsheet import/export
http://livecodeaddons.com/

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: XML Parsing Error

Post by jwbuzz » Thu May 13, 2010 4:58 pm

This turned out to be a simple typo.. I was passing theWebPageContent to the xml parser when I should have been passing tWebPageContent. Hopefully this will help someone in the future avoid the simple mistake.

Post Reply