Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Qweb Xpath of child node

By
Jo
on 2/1/16, 1:12 AM 666 views

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..

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

Yenthe
on 2/1/16, 1:50 AM
0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 2/1/16, 4:12 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/1/16, 1:12 AM
Seen: 666 times
Last updated: 2/1/16, 4:12 AM