What is namespace in xpath axes

Viewed 1994

I am looking into the XPath Axes and I am able to understand all below axes

'ancestor'
| 'ancestor-or-self'
| 'attribute'
| 'child'
| 'descendant'
| 'descendant-or-self'
| 'following'
| 'following-sibling'
| 'parent'
| 'preceding'
| 'preceding-sibling'
| 'self'

The only axes I am not able to understand is

| 'namespace'

Can anyone give me a good example and understanding about what 'namespace' actually do?

Example:-

Open :- https://www.google.co.in/

OR

HTML code

<a style="left:-1000em;position:absolute" href="/setprefs?suggon=2&prev=https://www.google.co.in/&sig=0_ujdR1PrGxEbi_EiD6RbIb4VvaXc%3D">Screen-reader users, click here to turn off Google Instant.</a>

I am trying the below xpath

  //a[@style='left:-1000em;position:absolute']/namespace::*[name()='google']

What is wrong I am doing in above namespace?

In addition I also want to know about that what is the use of axes | 'attribute'. where and in which situation it is helpful

2 Answers
Related