Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Bes XPath query? [Thread Next] Re: Bes XPath query?To: NULL Date: 5/13/2009 1:13:00 AM CxT wrote: > On May 8, 10:07 am, Joe Kesselman <keshlam.cat.nos...@verizon.net> > wrote: >> Quick reminder: The default namespace (xmlns=) is *not* applied to >> attributes. If you actually want an attribute name to be namespaced, you >> must use a prefix on it. > > This is the query that ended up working... I don't know why: > > "//td[. = 'Earnings/Share ']" I was just about to post that the data might have intrusive spaces: it's a common misapprehension by data-providers that leading and trailing spaces get trimmed by applications, because that's what browsers do with plain ol' HTML. Handling of white-space in XML is defined differently, so it's best to assume spaces are significant. When I'm scraping data from [X]HTML and need to reference the character data content of an element, I tend to normalise it, eg //td[normalize-space(.)='Earnings/Share'] ///Peter -- XML FAQ: http://xml.silmaril.ie/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
