PC Review


Reply
Thread Tools Rate Thread

Re: XPath Not Working with SelectNodes

 
 
cubaman
Guest
Posts: n/a
 
      28th Apr 2009
On Apr 27, 6:34*pm, SnapDive <SnapD...@community.nospam> wrote:
> I am trying to get a bunch of values into a collection with C# using
> an XPath statement that will let me get all of these HREF/objects:
>
> * * * * * * * * /d.html
> * * * * * * * * /e.html
> * * * * * * * * /f.html
>
> So far I have something like this, but it's not quite working:
> //div[contains(@class,'outerContainer')]/ul/li[contains(@class,'sectionHeader')/@value='GoodLinks'
> I think it's not working because d.html, e.html, f.html are not
> actually "inside" GoodLinks.
>
> This gets me a.html, b.html, c.html:
> //div[contains(@class,'outerContainer')]/ul/li/"
>
> <div class="outerContainer clearFix">
> * * * * <ul>
> * * * * * * * * <li><a href="/a.html"> this is a </a></li>
> * * * * * * * * <li><a href="/b.html"> this is b </a></li>
> * * * * * * * * <li><a href="/c.html"> this is c </a></li>
> * * * * </ul> * * * * * *
> * * * * <ul>
> * * * * * * * * <li class="sectionHeader">GoodLinks</li>
> * * * * * * * * <li><a href="/d.html"> this is d </a></li>
> * * * * * * * * <li><a href="/e.html"> this is d </a></li>
> * * * * * * * * <li><a href="/f.html"> this is d </a></li>
> * * * * </ul> * *
> * * * * <ul>
> * * * * * * * * <li class="sectionHeader">OtherLinks</li>
> * * * * * * * * <li><a href="/g.html"> this is g </a></li>
> * * * * * * * * <li><a href="/h.html"> this is h </a></li>
> * * * * * * * * <li><a href="/i.html"> this is i </a></li>
> * * * * </ul> * *
> </div>
>
> How should the XPath look?
> Thanks.


Take a look at XPather, a firefox plugging. Ideal for what you're
doing.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: XPath Not Working with SelectNodes Pavel Minaev Microsoft Dot NET Framework 0 27th Apr 2009 10:58 PM
xpath of SelectNodes() does not work when tag contains xmlns Jazper Microsoft Dot NET 1 27th Aug 2008 01:34 PM
selectnodes method not working =?Utf-8?B?R2xlbm4gVmVuemtl?= Microsoft Dot NET 0 29th Sep 2005 08:37 PM
XmlDocument.SelectNodes does not behave properly with some Xpath expressions =?Utf-8?B?WXVyeSBGZWRvcm92?= Microsoft Dot NET Framework 4 3rd Feb 2004 12:26 PM
3rd party xpath for CF (e.g. cuesoft xpath) Yechezkal Gutfreund Microsoft Dot NET Compact Framework 0 6th Nov 2003 02:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:38 PM.