Fix List <li> tag order

Jul 6, 2010 at 2:27 AM

I am trying to turn html into xhtml to go into a larger xml document. Unfortuantely I seem to have an issue with lists, I always end up with them in the format:

<ul>

<li>item1

<li>item2

</li></li>

</ul>

Meaning the li tags are nested in each other, this fails validation I need to get them in the form

<ul>

<li>item1</li>

<li>item2</li>

</ul>

 

Any ideas if this is possible, I would think this is the more logical ordering anyway.

 

Jul 6, 2010 at 2:50 PM
What was the source html that you were using?
Jul 6, 2010 at 5:07 PM
Edited Jul 6, 2010 at 5:12 PM

The source HTML lists look something like this:


<UL>
<LI>NVQ Level 3 in Fabrication and Welding Engineering
<LI>Level 3 Certificate in Engineering
<LI>Level&nbsp;2 Key Skill in Application of Number
<LI>Level&nbsp;2 Key Skill in Communication
<LI>Level&nbsp;2 Key Skill in Information Technology
<LI>Level 2 Key Skill in Working with Others
<LI>Level 2 Key Skill in Improving Own Learning &amp; Performance</LI></UL>

It was made in a WebBrowser control in .NET which I believe is a wrapper of internet explorer in edit mode.

As you can see all but the last </li> tag is omitted. The capitalization is actually how it is in the document. The correction to this to get it into xhtml seems to put all the </li> tags at the end which is understandable but I would say wrong. The schema for the xml I am trying to produce actually won't support it in that format, it doesn't like the nesting of <li> in <li>.