# xml question

**URL:** <https://forum.xojo.com/t/xml-question/36407>\
**Category:** Getting Started\
**Created:** [March 2, 2017, 1:09am UTC](https://forum.xojo.com/t/xml-question/36407 "2017-03-02T01:09:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loannis\_Kolliageorgas](https://forum.xojo.com/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@Loannis\_Kolliageorgas](https://forum.xojo.com/u/Loannis_Kolliageorgas)\
**Post date:** [March 2, 2017, 1:09am UTC](https://forum.xojo.com/t/xml-question/36407/1 "2017-03-02T01:09:55Z")

</div>

i am start using some xml files and in the bellow screenshot i have a small issue.  
The Root node have some Childs and i am stuck at the last four with the same name “cue\_v2”  
I want to know if is one child with the name"cue\_v2" or more so i will change my code accordingly…  
If i use the root node with childcount i will get 11 childs,but only i want to count the last with the same name…  
Something like \> if child.name = “cue\_v2” more than x then…  
Can anyone give a tip ?  
Thank you  
 ![](http://i63.tinypic.com/fegdjp.jpg)

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [March 2, 2017, 3:19am UTC](https://forum.xojo.com/t/xml-question/36407/2 "2017-03-02T03:19:30Z")

</div>

definitely not wrong for a node to contain one or more nodes with the same node type

i’d expect there’s a nice XQL query that could tell you the count - but I dont use XQL enough to be really conversant with what that might look like

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [March 2, 2017, 5:29am UTC](https://forum.xojo.com/t/xml-question/36407/3 "2017-03-02T05:29:41Z")

</div>

Xql returns a NodeList, which has a Count property.

---

<div class="post-metadata">

**Author:** ![Antonio\_Rinaldi](https://forum.xojo.com/user_avatar/forum.xojo.com/antonio_rinaldi/32/331_2.png) [@Antonio\_Rinaldi](https://forum.xojo.com/u/Antonio_Rinaldi)\
**Post date:** [March 2, 2017, 7:26am UTC](https://forum.xojo.com/t/xml-question/36407/4 "2017-03-02T07:26:43Z")

</div>

XQL has a length property

`dim xq as xmlNodeList=myDocument.documentElement.xql("cue_v2")
dim n as integer=xq.length`

then you can access the single nodes with

```auto
dim xn as xmlNode=xq.item(i) //where i is between 0 and n-1
```

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [March 2, 2017, 9:26am UTC](https://forum.xojo.com/t/xml-question/36407/5 "2017-03-02T09:26:36Z")

</div>

> [@318671:@Tim Hare](#):
>
> Xql returns a NodeList, which has a Count Length property.

---

<div class="post-metadata">

**Author:** ![Loannis\_Kolliageorgas](https://forum.xojo.com/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@Loannis\_Kolliageorgas](https://forum.xojo.com/u/Loannis_Kolliageorgas)\
**Post date:** [March 2, 2017, 10:48am UTC](https://forum.xojo.com/t/xml-question/36407/6 "2017-03-02T10:48:06Z")

</div>

Thank you @Tim Hare @Antonio Rinaldi @Norman Palardy

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:40pm UTC](https://forum.xojo.com/t/xml-question/36407/7 "2020-10-29T18:40:43Z")

</div>


