Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Matching attributes between elements [Thread Next] Re: Matching attributes between elementsTo: NULL Date: 9/1/2007 2:51:00 AM On Sep 1, 8:22 am, rich...@cogsci.ed.ac.uk (Richard Tobin) wrote: > In article <1188597678.852587.226...@x40g2000prg.googlegroups.com>, > Dylan Nicholson <wizof...@hotmail.com> wrote: > > >> > Just wondering if anyone knew if it was possible to select <input> > >> > elements in an XHTML document for which there exists a corresponding > >> > <label> element > >> Try: > >> //input[//label/@for=@id or ancestor::label] > >Nope, that only detects label elements that have a "for" and an "id" > >attribute with the same value. > > No it doesn't. Ignoring the ancestor::label bit, it returns <input> > elements whose id attribute is equal to some <label> element's for > attribute. Both //label/@for and @id are evaluated with the <input> > element as the context node. > > There are cases that have the difficulty you refer to, but this isn't > one of them. > > -- Richard Right you are...my apologies to the original poster! Thanks, Dylan | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
