Partial success with that resource, downloading it into a local script-only 
library stack...
put ConvertXMLToArray (tXML, "utf8") into tArrayXML

set the arrayData of widget 1 of this stack to tArrayXML


...successfully parses the XML nodes into array keys that get rendered into the 
TreeView widget - and I can set the third parameter to force ‘@value’ keys.

Unfortunately, there are no values being displayed in the TreeView - with or 
without ‘@value’ keys being forced on. 

I don’t think they’re being created in the array from a couple of quick tests 
and attempting to recreate the XML using…
put ConvertArrayToXML(tArrayXML)

…returns just a number

Any ideas gratefully received, meanwhile I’ll look for alternative resources, 
as this one (6 years old) may not be compatible with LiveCode 9.x...?
Best,
Keith 

> On 5 Jun 2019, at 08:27, Keith Clarke <[email protected]> wrote:
> 
> Thanks Ali - the 'XML to LiveCode multi-dimensional array’ handler should get 
> me close.
> Best,
> Keith
> 
>> On 5 Jun 2019, at 06:06, Ali Lloyd via use-livecode 
>> <[email protected]> wrote:
>> 
>> Not sure if it's exactly the format you're looking for but this code
>> snippet from Trevor DeVore converts between XML and LiveCode arrays:
>> https://gist.github.com/trevordevore/5584753
>> 
>> On Tue, 4 Jun 2019 at 18:57, Keith Clarke via use-livecode <
>> [email protected]> wrote:
>> 
>>> Hi folks,
>>> Is parsing an XML file into a LiveCode TreeView widget a sensible (and
>>> easy) approach to render it more human-readable to understand it’s
>>> structure & content, etc., for potential onward processing / transformation?
>>> 
>>> If so, can anyone please share the current state of the art for
>>> transforming an XML file to the requisite array form to seed the TreeView
>>> widget?
>>> Thanks
>>> Keith
>>> _______________________________________________
>>> use-livecode mailing list
>>> [email protected]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> [email protected]
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to