1 . Im doing XML parsing from a url.IN the XML response , how can I get the length of element tag ..
Eg :
<Company>
<Id>1</Id>
<name>A</name>
</Company>
<Company>
<Id>2</Id>
<name>B</name>
</Company>
IN this how can I get the no of ‘Company’ tags i.e 2
—> I got some GUID value in array when parsing XML and I am taking it in a string variable.But when I compare a particular value with the string variable it is not getting compared..Couldnot get where im going wrong ?
My array is
(
{
Id="84a6c6f6-b018-4f0e-8da4-c64bf76be764"
}
)
now Im taking it in string variable like this :
nam=[[arr objectAtIndex:0]objectForKey:@"Id"];
But if the result of arr is
(
{
Id=”00000000-0000-0000-0000-000000000000″
}
)
and if I compare
if(nam=@"00000000-0000-0000-0000-000000000000")
{
//do something
}
But here my cursor is not going to if stmnt if though Id is 00000000-0000-0000-0000-000000000000..How can i compare it ?
It is easy if you the name of tag, as while parsing, in a function “didStartElement” you can do so
Please let me know if that works for you