XML brain fault

Mark Smith lists at futilism.com
Wed Oct 29 20:10:42 EDT 2008


Girard, thanks! That's solved the problem.

Bien cordialement,

Mark

On 29 Oct 2008, at 20:48, GIRARD Damien wrote:

> Hi Mark,
>
> repeat for each line L in tList
>  revAddXmlNode tTree, tNode, "person", ""
>  put the result into TheNode
>  revAddXmlNode tTree, TheNode, "name", item 1 of L
>  revAddXmlNode tTree, TheNode, "sex", item 2 of L
> end repeat
>
> When you have multiple "/people/person" node, you can access them  
> with that: "/people/person[1]" ...
>
> Regards,
>
> Damien Girard
> Dam-pro.
>>
>> Can any kind soul explain how to do this?
>>
>> I have a list tList of "persons" like so:
>>
>> Mike,male
>> Paul,male
>> Sandra,female
>>
>> I want to end up with this:
>>
>> <people>
>>    <person><name>Mike</name><sex>male</sex></person>
>>    <person><name>Paul</name><sex>male</sex></person>
>>    <person><name>Sandra</name><sex>female</sex></person>
>> </people>
>>
>> Now when tNode is "people"
>>
>> repeat for each line L in tList
>>   revAddXmlNode tTree, tNode, "person", ""
>>   revAddXmlNode tTree, tNode & "/person", "name", item 1 of L
>>   revAddXmlNode tTree, tNode & "/person", "sex", item 2 of L
>> end repeat
>>
>> gets me this:
>>
>> <people>
>>   <person><name>Mike</name><sex>male</sex><name>Paul</ 
>> name><sex>male</sex><name>Sandra</name><sex>female</sex></person>
>>   <person></person>
>>   <person></person>
>> </people>
>>
>> So how do I get to create repeated sibling nodes of the same name?
>>
>> Any help much appreciated.
>>
>> best,
>>
>> Mark
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list