PDA

View Full Version : LzDatapointer length


ander_line
05-11-2006, 04:44 AM
hello people,

In my app, I get a XML from a action that have some informations such as:

<maquinas>

<maquina>
<nrSerie>3917484</nrSerie>
</maquina>

<maquina>
<nrSerie>3917484</nrSerie>
</maquina>

</maquinas>

I use a dataPointer to cont the elements "maquina", but it´s going very hard to do because my app is growing up with more implementations and it is stilling obsolete.

I´m doing something like that:

<method ...>
var bool = true;
var i=0;
while(bool == true){
i++;
var xpath="dataset:/maquinas[1]/maquina["+i+"]";
datapointer.setXPath(xpath);
if(datapointer.selectChild()){
nrMaquina++;
}else{
bool=false
}
</method>

and, with this iteration, I get the global var "nrMaquina" and get the size of the elements in XML.

but, as you can see, it is very primitive.
there is any component that I can "get" the length of the dataPointer?

thanks anyway and sorry for my bad english.