Xpath help function

Posted by NA on Stack Overflow See other posts from Stack Overflow or by NA
Published on 2010-04-27T15:56:26Z Indexed on 2010/04/27 16:13 UTC
Read the original article Hit count: 159

Filed under:
|
|

Hi i have a document from which i am trying to extract a date. But the problem is within the node along with the date their is some text too. Something like

 <div class="postHeader">  
Posted on   
 July 20, 2009  9:22 PM PDT  

  </div>  

From this tag i just want the date item not the Posted on text. something like
./xhtml:div[@class = 'postHeader']
is getting everything. and to be precise, the document i have is basically a nodelist of this elements for eg i will get 10 nodes of these elements with different date values but to be worse the problem is sometime inside these tags some random other tags also pops us like anchors etc. Can i write a universal expath which will just get the date out of the div tag?

© Stack Overflow or respective owner

Related posts about xpath

Related posts about function