/Root/Configuration/TaskSelectorControl/QueueSelector
is not equivalent to:
/Root/Configuration/TaskSelectorControl[@Name='QueueSelector']
The above XPath selects <TaskSelectorControl Name="QueueSelector">
, not <QueueSelector>
children of <TaskSelectorControl>
.
You could either do this in XPath:
/Root/Configuration/TaskSelectorControl/*[local-name(.)=sql:variable("@AttributeName")]
Or it might be simpler to concat prior to evaluating:
'/Root/Configuration/TaskSelectorControl/' + @AttributeName