PDA

View Full Version : targeting variables loaded from XML??


maccer
09-06-2002, 12:23 PM
Hi can anybody help me with targeting variables loaded from XML?,

If i had say three dynamic text fields in my movie[title, time, desciption,] how could i call a particular ID number that would then insert all the right data from that node?

i.e XML
<?xml version="1.0"?><backslash>

<story>
<title>Title 1</title>
<time>01 September 2002</time>
<description>description</description>
<topic>1</topic>
</story>
<story>
<title>Title 2title>
<time>01 September 2002</time>
<description>description</description>
<topic>2</topic>
</story>

<story>
<title>Title 3</title>
<time>29 August 2002</time>
<description>description</description>
<topic>3</topic>
</story>


</backslash>

Any help or guidance to tutorials would be much appreciated, cheers maccer

hangalot
09-10-2002, 11:28 PM
its a nested loop


create XML obj
loop(1) through the firstchild's childNodes
loop(2) through (loop[1].resultNode)'s childnodes
if elementName = "id"
then its textNode would be the val
loop(2) close
end loop (1)

unless somebody knows of XPath type functionionality in actionS,
pleeaze!

maccer
09-11-2002, 07:50 PM
Hi Hagalot, thanks alot for replying, i can sort of understand the logic you've provided, but a still a bit vague on how to implement it?

I've attached the source file if this helps understand what im trying to learn to do? Basically just as you said, i have a list of links created from XML if one of them are clicked i'd like the other node values from taht ID to be displayed..

If you could help me with this, your doing me a massive favour, and i'd really owe you again :)

thanks alot
andy