Given the following XML-compliant HTML:
<div>
<a>a1</a>
<b>b1</b>
</div>
<div>
<b>b2</b>
</div>
<div>
<a>a3</a>
<b>b3</b>
<c>c3</c>
</div>
doing //a will return:
[a1,a3]
The problem with above is that the third column data is now in second place, when A is not found it is completely skipped.
how can you express an xpath to get all A elements which will return:
[a1, null, a3]
same case for //c, I wonder if it's possible to get
[null, null, c3]
UPDATE: consider another scenario where are no common parents <div>.
<h1>heading1</h1>
<a>a1</a>
<b>b1</b>
<h1>heading2</h1>
<b>b2</b>
<h1>heading3</h1>
<a>a3</a>
<b>b3</b>
<c>c3</c>
UPDATE: I am now able to use XSLT as well.