I am trying to obtain the bullet numbers that is nested (1.1, 1.2, a., b., etc) from a webpage that looks like this:
1 Definitions
1.1 Abcdef.
1.2 Ghijkl:
a. abcd
b. efgh
c. etc...
The html code is below:
<ol>
<li>
<h3 style="padding-left: 43pt;text-indent: -36pt;text-align: justify;">Definition</h3>
<p style="text-indent: 0pt;text-align: left;"><br /></p>
<ol id="l3">
<li>
<p style="padding-left: 43pt;text-indent: -36pt;text-align: justify;">In this Notice:</p>
<p style="text-indent: 0pt;text-align: left;"><br /></p>
<ol id="l4">
<li>
<p style="padding-left: 7pt;text-indent: 0pt;text-align: justify;">Code of conduct.</p>
<p style="text-indent: 0pt;text-align: left;"><br /></p>
</li>
<li>
<p style="padding-left: 7pt;text-indent: 0pt;text-align: justify;">The following:</p>
<p style="text-indent: 0pt;text-align: left;"><br /></p>
<ol id="l5">
<li>
<p style="padding-left: 79pt;text-indent: -36pt;line-height: 16pt;text-align: left;">trains</p>
</li>
<li>
<p style="padding-left: 79pt;text-indent: -36pt;text-align: left;">Buses</p>
</li>
<li>
<p style="padding-left: 79pt;text-indent: -36pt;line-height: 16pt;text-align: left;">PLanes</p>
I have tried searching everywhere but not able to find an elegant solution. Tks!
--Update--
Adding the css section which has the counter function which increments the bullets. I have a hunch that the possible solution should probably use this function. Thanks!
<style type="text/css">
#l1 {
padding-left: 0pt;
counter-reset: c1 1;
}
#l1>li>*:first-child:before {
counter-increment: c1;
content: counter(c1, decimal)" ";
color: black;
font-family: "Times New Roman", serif;
font-style: normal;
font-weight: bold;
text-decoration: none;
font-size: 14pt;
}
#l1>li:first-child>*:first-child:before {
counter-increment: c1 0;
}
#l2 {
padding-left: 0pt;
counter-reset: c2 1;
}
#l2>li>*:first-child:before {
counter-increment: c2;
content: counter(c1, decimal)"."counter(c2, decimal)" ";
color: black;
font-family: "Times New Roman", serif;
font-style: normal;
font-weight: normal;
text-decoration: none;
font-size: 14pt;
}
#l2>li:first-child>*:first-child:before {
counter-increment: c2 0;
}
</style>