Skip to content Skip to sidebar Skip to footer

How Can I Combine Two Nodecollection?

I got var x = document.DocumentNode.SelectNodes('*//tr[@class='even']') var y = document.DocumentNode.SelectNodes('*//tr[@class='odd']') How can I combine these html node colle

Solution 1:

Another option is using XPath approach. You can use XPath union (|) to combine two queries :

var xy = document.DocumentNode
                 .SelectNodes("*//tr[@class='even'] | *//tr[@class='odd']");

Post a Comment for "How Can I Combine Two Nodecollection?"