//
means descendant or self. You are selecting any strong
element in any context. [...]
is a predicate which restricts your selection according to some boolean test. There is no strong
element with a class
attribute which equals txt ext
, so you can exclude your second expression.
Your last expression will actually return a node-set of all the strong
elements which have a param
attribute. You can then extract individual nodes from the node set (use [1]
, [2]
) and then get their text contents (use text()
).
Your first expression selects the text contents of both nodes but it's also wrong. It's in the wrong place and you can't select node zero (it doesn't exist). If you want the text contents of the first node you should use:
//strong[@class="param"][1]/text()
and you can use
//strong[@class="param"][2]/text()
for the second text.