Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Bes XPath query?

From: Peter Flynn <peter.nosp@-.--------.-->
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent