I was following this topic but still can not resolve bellow described issue. Inside <ol>
elements I need to wrap arbitrary elements (/nodes) into <li>
according this example:
<ol>
text
<p>text</p>
<li>
text
<p>text</p>
</li>
<p>text</p>
text
<sub>text</sub>
</ol>
Convert to:
<ol>
<li>
text
<p>text</p>
</li>
<li>
text
<p>text</p>
</li>
<li>
<p>text</p>
text
<sub>text</sub>
</li>
</ol>
I am using xslt 1.0. Highly appreciate any help!
UPDATED EXAMPLE
<root>
<ol>
text
<p>text</p>
<li>
text
<p>text</p>
</li>
<p>text</p>
text
<sub>text</sub>
</ol>
<ol>
text
<p>text</p>
</ol>
</root>
Convert to:
<root>
<ol>
<li>
text
<p>text</p>
</li>
<li>
text
<p>text</p>
</li>
<li>
<p>text</p>
text
<sub>text</sub>
</li>
</ol>
<ol>
<li>
text
<p>text</p>
</li>
</ol>
</root>
` as a root element. But it is not exactly my case. Therefore, I updated question. I will try to adapt your solution.
– PrincAm Dec 10 '15 at 09:28