Reputation: 681
I was actually trying to print multiple values of the same attribute Title
with comma after each but couldn't remove comma after the last value which resulted in me writing complex loops.
Here I have initiated a count variable storeCount
which increments and until it reaches the number of rows returned, I print Title
and a comma that follows.
Here's my code. I am getting syntax error. I would appreciate help fixing the code.
<?for-each@inlines:G_1?>
<?xdoxslt:set_variable($_XDOCTX, 'storeCounter', xdoxslt:get_variable($_XDOCTX, 'storeCounter') + 1)?>
Title
<?if@inlines:<?count(G_1)?> != <?xdoxslt:get_variable($_XDOCTX, 'storeCounter')?>?>
,
<?end-if?>
<?end for-each?>
Upvotes: 0
Views: 1165
Reputation: 1589
This should work:
<?for-each@inlines:G_1?>
<?xdoxslt:set_variable($_XDOCTX, 'storeCounter', xdoxslt:get_variable($_XDOCTX, 'storeCounter') + 1)?>
Title
<?if@inlines:count(G_1) != xdoxslt:get_variable($_XDOCTX, 'storeCounter')?>
,
<?end-if?>
<?end for-each?>
Upvotes: 1
Reputation: 1953
Upvotes: 0