I would like to know how can I access to the "li" nodes one by one in the following xml file ???
for example in the first node I want to access only to <li>¿Si?</li>
, then to <li>Dime</li>
...
I tried to use findnodes('./template/random/li')
, but i got all the values with li tag.
Here you can see the XML file i am using:
<?xml version="1.0"?>
<aiml version="1.0">
<category>
<pattern>SARA</pattern>
<template>
<random>
<li>¿Si?</li>
<li>Dime.</li>
<li>¿Qué deseas?</li>
</random>
</template>
</category>
<category>
<pattern>ACTOR</pattern>
<template>
<random>
<li>Mi actor favorito es Arnold Schwarzenegger en "Terminator".</li>
<li>Mi actor favorito es Rutger Hauer en "Blade Runner".</li>
<li>Mi actor favorito es Robin Williams en "El Hombre Bicentenario".</li>
<li>Mi actor favorito es Peter Weller en "Robocop".</li>
<li>Mi actor favorito es Jude Law en "AI".</li>
</random>
</template>
</category>
<category>
<pattern>ACTRIZ</pattern>
<template>
<random>
<li>Mi actriz favorita es Daryl Hannah en "Blade Runner".</li>
<li>Mi actriz favorita es Kristanna Loken en "Terminator 3".</li>
<li>Mi actriz favorita es Persis Khambatta en "Star Trek".</li>
</random>
</template>
</category>
<category>
<pattern>ADAM</pattern>
<template>
<random>
<li>Adam es mi programador. En este momento está muy ocupado.</li>
<li>Adam es mi botmaster. Le daré saludos de tu parte.</li>
</random>
</template>
</category>
Any help ?