# Get a childNode by it's unique attribute ID

**URL:** https://forum.kirupa.com/t/get-a-childnode-by-its-unique-attribute-id/178428
**Category:** Uncategorized
**Created:** [February 10, 2006, 1:46pm UTC](https://forum.kirupa.com/t/get-a-childnode-by-its-unique-attribute-id/178428 "2006-02-10T13:46:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![undersound](https://avatars.discourse-cdn.com/v4/letter/u/bbe5ce/32.png) [@undersound](https://forum.kirupa.com/u/undersound)
#### Post date: [February 10, 2006, 1:46pm UTC](https://forum.kirupa.com/t/get-a-childnode-by-its-unique-attribute-id/178428/1 "2006-02-10T13:46:28Z")

</div>

Hello everyone,

From a php processed xml file i want to grab a specific childnode by it’s unique ID which is in the attribut tag ID in the page childnode.  
For example i want to get the \<pageTitle\> and \<pageContent\> for the page with ID=“6”

```auto

[COLOR=#0000ff]<[/COLOR][COLOR=#990000]Page ID[/COLOR][COLOR=#0000ff]="[/COLOR] **11** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] SiteSubjectID[/COLOR][COLOR=#0000ff]="[/COLOR] **7** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] PageTypeID[/COLOR][COLOR=#0000ff]="[/COLOR] **1** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] PageType[/COLOR][COLOR=#0000ff]="[/COLOR] **Main page** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] SubjectPageOrder[/COLOR][COLOR=#0000ff]="[/COLOR] **1** [COLOR=#0000ff]">[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]Page ID[/COLOR][COLOR=#0000ff]="[/COLOR] **6** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] SiteSubjectID[/COLOR][COLOR=#0000ff]="[/COLOR] **3** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] PageTypeID[/COLOR][COLOR=#0000ff]="[/COLOR] **1** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] PageType[/COLOR][COLOR=#0000ff]="[/COLOR] **Main page** [COLOR=#0000ff]"= [/COLOR][COLOR=#990000]SubjectPageOrder[/COLOR][COLOR=#0000ff]="[/COLOR] **1** [COLOR=#0000ff]">[/COLOR]
 
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]PageTitle[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<![CDATA[[/COLOR] [SIZE=3]Order info[/SIZE] [COLOR=#0000ff]]]>f(clean);[/COLOR] 
 [COLOR=#0000ff]</[/COLOR][COLOR=#990000]PageTitle[/COLOR][COLOR=#0000ff]>[/COLOR]
 
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]PageContent[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<![CDATA[[/COLOR] [SIZE=3]Order info content[/SIZE] [COLOR=#0000ff]]]>f(clean);[/COLOR] 
 [COLOR=#0000ff]</[/COLOR][COLOR=#990000]PageContent[/COLOR][COLOR=#0000ff]>[/COLOR]
 
 
 [COLOR=#0000ff]</[/COLOR][COLOR=#990000]Page[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]Page ID[/COLOR][COLOR=#0000ff]="[/COLOR] **2** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] SiteSubjectID[/COLOR][COLOR=#0000ff]="[/COLOR] **2** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] PageTypeID[/COLOR][COLOR=#0000ff]="[/COLOR] **1** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] PageType[/COLOR][COLOR=#0000ff]="[/COLOR] **Main page** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] SubjectPageOrder[/COLOR][COLOR=#0000ff]="[/COLOR] **1** [COLOR=#0000ff]">[/COLOR]

```

The way I grab the content now is by using the \* from the for loop i created to get all the content and replace that with the number on which place it resides in the loop.

```auto
title_txt.text = _root.valuesArray['Pages'][2]['PageTitle'];

```

But since the childnodes are not be giving back in that order i get the wrong content back.

How can i reach the content in the childnode with for example ID=“6” so that i get the right content back indepent from where the childnodes resides in the loop?

Thnx in advance

Greetz  
Undersound
