TBXML not parsing TBXMLElement text, while child element tags also present in existing parent tag?

155 Views Asked by At

My XML is like this:

<office>
   <item>
    NOIDA OFFICE:
    <OfficeAddress>B-20, SECTOR 57 NOIDA (U.P) 201301</OfficeAddress>
   </item>
</office>

And I am trying to parse with TBXML parser.

Here my problem is, OfficeAddress value is accessible as a child element of item but text of <item> NOIDA OFFICE: is not getting parsed.

Its showing me text of <item> is NULL and showing only one child element <OfficeAddress> with associated text.

I want to parse NOIDA OFFICE: as item name. Anyone please help me, Advance appreciate on your help.

Happy coding :)

1

There are 1 best solutions below

1
wesley On

I think you are not able parse your XML. Please change the xml in server side like this.

<Office>
<item name=NOIDA OFFICE>
<OfficeAddress>B-20, SECTOR 57 NOIDA (U.P) 201301</OfficeAddress>
</item>
</Office>