Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

find the size of a XML tree node

Avatar

Former Community Member
Hi,

Is it possible to find the size of a XML variable's tree node. I tried to used the get-collection-size, but it alway hit a nullpointer exception? Is the function just for list and map type? Not for XML type?



I have xml as:

<data>

<current_user>

<username>apink</username>

</current_user>

<current_user>

<username>tblue</username>

</current_user>

</data>



/process_data/numofuser = get-collection-size(/process_data/xmldata/data/current_user)



Thanks.
1 Reply