hi all,
i would like to convert xhtml to dokuwiki syntax using xslt.
now, one thing i can not seem to work my head around is how to handle nested lists. the dokuwiki syntax uses an asterisk (*) for a list item which is prepended by two white spaces per nesting level (c.f. wiki syntax).
my question: in the following example, how can the <xsl:template mach="li"> that matches the list item 2.1.1 be aware of it's nesting level, in order to prepend the right amount of white spaces?
* list item 1
* list item 2
* list item 2.1
* list item 2.1.1
* list item 2.2
* list item 2.3
* list item 3
corresponds to
- list item 1
- list item 2
- list item 2.1
- list item 2.1.1
- list item 2.2
- list item 2.3
- list item 2.1
- list item 3
which is how the following html is displayed:
<ul>
<li>
list item 1
</li>
<li>
list item 2
<ul>
<li>
list item 2.1
<ul>
<li>list item 2.1.1</li>
</ul>
</li>
<li>list item 2.2</li>
<li>list item 2.3</li>
</ul>
</li>
<li>
list item 3
</li>
</ul>