match="foo[@bar]" finds foo elements that have are children of the current node, and have a bar attribute
match="foo/@bar" finds bar attributes of foo children of the current node
if this is in an apply-templates, then the current node in the matching template will be the foo element in the first case but an _attribute node_ in the second.
match="foo/@bar" does not mean `children' it means `next step' and at each step you can change axis along which to travel, here you have @ which is short for attribute::, and no specified axis is short for child:: so the above is really
child::foo/attribute::bar
which means get bar attributes of foo children.
<xsl:when test="$counter<'1'">
'1' is the string 1, on which you can't do a less than test. You want the number 1, so use
<xsl:when test="$counter < 1">
> What I am trying to do is simply to test if the number of ELT is less > than 1
If that's all you want to do with the count, you don't need a variable at all:
<xsl:when test="count(ELT) = 0">
since it's a count frrom a node list, it can't be negative, so = 0 seems a simpler test than < 1.
In fact that is just testing whether there are any ELT, for which you don't need count() as an empty node list counts as false,
<xsl:when test="ELT">