help to understand XPath -


i have such xpath expression :

link[@rel='alternate' , @type='text/html' or not(@rel)]/@href | link/text() 

?

acctually don't understand symbol |

the pipe ( | ) in xpath combines expressions. return href attribute link elements (that match predicate) , text content of links

so given fragment like

  <link>test</link>   <link href="http://www.google.com">google</link>   <link rel="zzzz" href="http://www.stackoverflow.com">stack overflow</link> 

you'd get:

test http://www.google.com google stack overflow 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

gdi+ - WxWidgets draw a bitmap with opacity -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -