sure looks like the reasonable start! but you'll get all the 'item's in that
loop regardless of their nesting.

You need just the children of items first, then deal with their children,
perhaps recursively.

On 4/14/07, systemaddict <[EMAIL PROTECTED]> wrote:


Hello

I've got an external xml file like this:

<items>
   <item>1</item>
   <item>2
      <item>2.1</item>
      <item>2.2/</item>
   </item>
   <item>3
      <item>3.1</item>
   </item>
</item>

Now, how would I make this into a nice ordered list like this with
jQuery:

<ol>
   <li>1</li>
   <li>2
      <ol><li>2.1</li><li>2.2</li><li>2.3</li></ol>
   </li>
   <li>3
      <ol><li>3.1</li></ol>
   </li>
</ol>

My starting code looks something like this:

$(document).ready(function() {
        $.get("whatever.xml", function(data){
                $("item", data).each(function(){

                });
        });
});




--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

Reply via email to