I have an html ordered list with differnent types e.g
<ol type=a>
<li>This is list item a</li>
<li>this is list item b</li>
</ol>
<ol type=i>
<li>This is list item 1</li>
<li>this is list item 2</li>
</ol>
I want to know if we can convert them into xml markup mentioned below.
<xml>
<orderlist>
<li>
<num>a</num>
<text>This is list item a</text>
</li>
<li>
<num>b</num>
<text>This is list item b</text>
</li>
</orderlist>
</xml>
<xml>
<orderlist>
<li>
<num>i</num>
<text>This is list item 1</text>
</li>
<li>
<num>ii</num>
<text>This is list item 2</text>
</li>
</orderlist>
</xml>
I can put match template for LI and easily get the text but how to get the numbering based on type attribute… ie a,b,c …. i, ii, iii, iv and so on… Any help will be appreciated.
If your HTML is well-formed XML, yes:
XML Input
XSLT 1.0
XML Output