Skip to Content
Menu
This question has been flagged
2 Replies
8591 Rodiniai

Hi all,

Here i want insert a <li> item inside existing <ul>.

I tried this,

XML

<ul id="top_menu">
    <li><a>1</a></li>
    <li><a>2</a></li>
    <li><a>3</a></li>
</ul>
XPATH

  <xpath expr="//ul[@id='top_menu']/li[1]" position="after">
     <li><a>100</a></li>
  </xpath>
I got my new item "100" at last item of <ul>. but i need it in after 1 item.

Thanks in advance..
Portretas
Atmesti

You could also use "//ul" position="inside"

Best Answer

I've tested your code, and it works fine with me. As expected ....

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
bal. 23
8126
3
bal. 21
7881
3
rugs. 20
4143
2
birž. 20
5244
2
bal. 20
5863