XUL:XPath in Overlays: Difference between revisions

 
Line 30: Line 30:


--[[User:Eyalroz|Eyalroz]] 22:18, 26 April 2006 (PDT)
--[[User:Eyalroz|Eyalroz]] 22:18, 26 April 2006 (PDT)
Items in a node list can be referenced using the [#] predicate (where # is the one-based node index). So to limit the application of the above overlay to only the first matching element you could use:
  <overlayitem match="//menupopup[@id='help-popup']'''[1]'''">
    <menuitem id="help-xul" label="Help on XUL" />
  </overlayitem>
insertbefore/insertafter may not be needed because XPath has:
  preceding-sibling::*[1]
  following-sibling::*[1]
--[[User:Mikecaines|Mikecaines]] 23:14, 26 Nov 10 (ADT)