Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have an XML document that has an optional number of elements. From 0 to say 10. We only can use the first 2.

The for-each list does not seem to have any limits.

Please advise on how to get just the first 2 of a series of elements. There is a length attribute of the parent i.e.
XML
<parent length="4">
<kid>Val1</kid>
<kid>Val2</kid>
<kid>Val3</kid>
<kid>Val4</kid>
</parent>
Posted
Updated 10-Dec-12 9:05am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900