XMLAndArray library ConvertXMLToArray() function - prep.

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Sat May 14 13:06:09 EDT 2011


...looking close, I see that before the array conversion stage, Trevor's library wraps the revCreateXMLTree() function to create a tree from the xml file. So, I inserted a breakpoint to "answer the TreeID" as soon as it is created. 

This revealed an error that wasn't being returned - "xmlerror, can't parse xml - Premature end of data in tag doc line 1".

It's not solved the problem - or isolated what is wrong with the input xml (as it comprises only 1 line!), but now I know to dig into revXML library requirements for xml pre-processing - and I can prove this step before worrying about the array conversion.

All part of the fun!

Best,
Keith..     

On 14 May 2011, at 16:48, Keith Clarke wrote:

> Hi Jim,
> Thanks for responding. Viewed in a field, (with 'dontWrap' set to true), the XML is as expected - a single, long string, without spaces or returns. Copying it into TextWrangler, I can't see anything unusual. 
> I've now also checked that the XML within the variable (prior to putting into the field to read) contains no null characters. 
> Bizarre!
> Still, I'll keep prodding it & Googling for troubleshooting ideas!
> Best,
> Keith..
> 
> On 14 May 2011, at 16:14, Jim Ault wrote:
> 
>> On May 14, 2011, at 7:24 AM, Keith Clarke wrote:
>>> I'm learning about XML & Arrays by attempting to process some web service call responses using the ConvertXMLToArray() in Trevor DeVore's XMLAndArrays library http://revonline2.runrev.com/stack/571/XMLAndArrays
>>> 
>>> The XML data looks fine to the human eye when put into a field, but the output array from the above function seems to be empty.
>>> 
>>> I noticed in the library's related TestXMLToArray function (which works on an imported file and then calls the above) that there is some pre-processing with "put URL ("binfile:" & it) into theXML" but I tried this without success.
>>> 
>>> Any clues as to what I've overlooked?
>> 
>> 
>> There is one data source I found on the internet that I had to use the following:
>> 
>> replace null with empty in outsiderDataBlock
>> 
>> The filter command fails if any null chars are in the text block.
>> 
>> Additionally, can you inspect the text block in something like BBEdit so you can see any odd chars?
>> 
>> Jim Ault
>> Las Vegas
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 





More information about the use-livecode mailing list