KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to create a counter in xquery. My initial attempt looked like the following: let $count := 0 for $prod in $collection let $count := $count + 1 return <counter>{$count }</counter> Expected result: <counter>1</counter> <counter>2</counter> <counter>3</counter> Actual result: <counter>1</counter> <counter>1</counter> <counter>1</counter> The $count variable either failing to update or being reset. Why can't I reassign an existing variable? What would be a better way to get the desired result?
Tags (comma-separated)
Save Edits
Cancel